← Back to Creation of Digital Den

Part 6: Invisible Headings and Stale Packages

By Ed CoyeSeptember 15, 2026

Around September 15 I noticed that some headings inside Sanity Studio had vanished. They were there, just white text on a white background. A small bug, but it taught two lessons that apply far beyond this one site.

The leaky style rule

Digital Den is a dark site, so its main style sheet says, in effect, "make every heading white." That's fine for the public pages. But Studio lives inside the same site, at /studio, so it inherited that rule too. Studio's editing area is light, and it doesn't set its own heading color, so my headings turned white on white.

The fix was to wrap Studio in its own container and reset the heading color only inside it. A global style rule behaves a lot like a global variable in an old program: convenient until it shows up somewhere you never meant it to.

The upgrade came back to bite

Before we could even test the fix, the build failed with a strange error about React. It was the same family of error from the Sanity 6 upgrade I'd parked a few days earlier. How could it be back, when I was on the main branch?

Here's the catch. Your installed packages live in a folder called node_modules, and that folder isn't part of the code git keeps track of. Switching branches swaps your code, but it leaves whatever packages are installed sitting there on disk. My computer still had the version 6 packages from the experiment. One command, npm ci, wiped them and reinstalled exactly what the main branch expects, and the build passed.

A better way to take instructions

This was also the session where I asked for paste-ready terminal commands instead of instructions to edit files by hand. The commands Claude gave me included a safety check that confirmed the file looked the way we expected before changing anything. That's a habit worth keeping: look before you leap, even when the AI is the one leaping.

The lesson

A global style rule is like a global variable: it leaks everywhere, including into tools you embed. And your installed packages aren't part of your saved code, so when something is weird after a branch switch, reinstall.

Try it yourself

If you're more comfortable running commands than editing files, tell the AI so, and ask it to include a check that confirms the starting state before any change. And if your project starts acting up right after you switch branches, try a clean reinstall before you start debugging anything else.

Next time: letting AI write the first draft of every article, while I keep my hand on the publish button.

Discussion

No comments yet — be the first to say something.