Debugging a Docker build that silently dropped all CSS
· 10 min read
I had a bug that looked simple and turned out to be two unrelated bugs wearing a trench coat. The symptom: pnpm run build on a laptop produced a perfectly normal Next.js app, styles and all. The exact same code, built inside the Docker image we ship to production, produced an app with zero CSS. Not broken CSS no CSS. No <link> tags pointing to missing files, no 404s, nothing. The build didn't even try.

This is the story of tracking that down, because the actual cause was strange enough that it's worth writing up.