Static CSS in the overlay — 19 interpolations were hanging every build

Fixkamo-internal
Shipped
September 3, 2026 at 7:33 AM UTC
Author
Kamo
Commit
0db8f9a

kamo-internal has been unable to produce an image since b08f3b34. `next build` did not fail, it HUNG: no output, no error, no timeout. `.next` frozen at 1.3 MB while two threads burned 200% CPU and wrote nothing to disk, for as long as anyone was willing to wait. InlineImageOverlay's `<style jsx global>` block carried nineteen `${OVERLAY_CLASS}` interpolations, one per selector. styled-jsx treats every hole in a CSS template as a dynamic value and reasons about the stylesheet around each one; nineteen in a single 109-line block sends the compiler into a spin that never terminates. OVERLAY_CLASS is `const OVERLAY_CLASS = 'kamo-iio'` — a compile-time constant — so every one of those holes was interpolating a value that never changes. Writing the prefix out is the whole fix. Same selectors, same CSS, same class names, and the file is otherwise untouched: 602 lines in and 602 lines out. Measured on the same worktree, same node_modules, same messages/: with the interpolations never finishes (killed at 10m, .next 1.3 MB) without them ✓ compiled in 117s, .next 379 MB Bisected rather than guessed, because a hang looks exactly like a slow machine from the outside and was mistaken in turn for a heap ceiling, for runner contention from orphaned builds, and for a full disk. It is none of those: the runner has 120 GB free, no CPU quota, and 5730c01e compiles in 96s on the same box. Both Turbopack and webpack hang, which is the tell — they share this transform. OVERLAY_CLASS stays the single source of truth for the markup; only the CSS text is literal. inlineImageOverlayCss.test.ts guards both halves of that: it fails if an interpolation is reintroduced, and it fails if the literal selectors and the constant drift apart.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing