Skip to content

ci: drop lockfile-agnostic Next.js cache restore-key - #704

Merged
ethanasm merged 1 commit into
mainfrom
claude/fix-nextjs-cache-key
Aug 15, 2026
Merged

ci: drop lockfile-agnostic Next.js cache restore-key#704
ethanasm merged 1 commit into
mainfrom
claude/fix-nextjs-cache-key

Conversation

@ethanasm

@ethanasm ethanasm commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • Main went red after build(deps-dev): bump the dev-dependencies group across 1 directory with 5 updates #699 (a dev-dependency bump, including @types/node) merged: pnpm build failed with Module not found: Can't resolve '@vercel/turbopack-next/internal/font/google/font'.
  • Root cause: the Restore Next.js incremental cache step's restore-keys had a lockfile-agnostic fallback (nextjs-${{ runner.os }}-). When the lockfile-hash-scoped key missed (lockfile changed), it fell back to restoring any .next/cache for the OS, including one built against an incompatible dependency graph (a different @types/node-qualified next peer instance). Turbopack then failed to resolve its own internal virtual font module against the mismatched cache.
  • Fix: drop the lockfile-agnostic fallback so a lockfile change always starts from a cold .next/cache instead of restoring a possibly-incompatible one.
  • Verified locally: pnpm install --frozen-lockfile + a clean pnpm build (no stale cache) succeeds fine on the current lockfile — confirming the dependency bump itself is safe and the stale cache was the actual cause.

Test plan

  • Local pnpm build succeeds with a cold .next/cache on the current lockfile.
  • CI Build job goes green on this PR.

The broad nextjs-${{ runner.os }}- fallback let a lockfile change
restore a .next/cache built against a different dependency graph.
After #699 bumped @types/node, the mismatched cache broke Turbopack's
internal font module resolution and reddened main.
@ethanasm
ethanasm merged commit 11f832e into main Aug 15, 2026
12 checks passed
@ethanasm
ethanasm deleted the claude/fix-nextjs-cache-key branch August 15, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants