News

The monster under the bed

Ismael —

The monster under the bed

WARNING: This post is a bit different and talks mostly about software development, so feel free to skip it if you were looking for D&D content!

I've been getting pestered by a very annoying bug in the website's source code, one that appeared only when I was running it in development mode on my PC. Just this morning I finally identified its source, and now I can actually use my free time to build new stuff instead of banging my head against the wall trying to fix it.

This... monster of a bug froze the website at random times whenever I refreshed it to apply an update in real time. When it happened, the only way to get the site back was to wipe the local cache. There were no errors, no logs, no clues. I had wasted so much time on it that I was starting to feel a mix of irritation and mild nausea whenever I thought about digging back into it.

I reviewed all my code. I even tried a "divide and conquer" approach where I removed half of the codebase to see if it still happened, then narrowed it down from there. Nothing worked. The bug just refused to be found.

In the end, it was a mixture of two different things that cooperated to create it, and neither of them was actually in the website's code: first, the tool that runs and builds the website (Vite) would discover "dependencies" (pieces of code the website needs) and initially refresh the site multiple times in order to "optimize" them. Meanwhile, a browser extension called Bitwarden (a password manager I use) was interfering with this process by injecting its own code into the site, which apparently corrupted or invalidated the optimization step and caused the freeze.

Trying to fix it over the past weeks did lead to some improvements: cleaning up circular dependencies, removing useless tools, and raising the overall quality of the code. The site is now much faster and more organized, but you know... I wish I could have made more progress on the features I wanted to build instead of fighting this invisible monster.

Anyway, I was able to make some progress despite all this, and in a couple of days I should be able to release a new update, this time about multiclassing!

-Ismael

This is a test environment. Any data you enter will be deleted in the future. Do not store any information that you want to keep.