Skip to content

Commit a05dffc

Browse files
fforootdclaude
andauthored
build: compile the docs without Turbopack's persistent cache (#2695)
## Context - Refs #2684. Since it merged, every preview that contains it has failed `docs (Preview)` at `site.browser.spec.ts:258`: `/docs/concepts/flows-and-schemas` puts its h1 at x=462.5 instead of 310.5 (seen on #2558 and #2676). ## Summary - Next 16.4 turns `experimental.turbopackFileSystemCacheForBuild` on by default, so `next build` reuses Turbopack's cache in `.next/cache`. Vercel restores that folder from an earlier deployment, and Turbopack served `app/global.css` from before #2684. The failing preview's CSS chunk matched main's production chunk except for the missing `#fd-spacious-layout:not(:has(…))` rule. Turbo's own cache wasn't involved: it reported a miss and ran `next build`. - `apps/docs/next.config.mjs` turns that cache off, so every docs build compiles from source. The cost is a somewhat slower `next build` on Vercel. ## Validation - Redeployed #2558's commit `470317b49` without the build cache (`POST /v13/deployments?forceNew=1`). The log shows "Skipping build cache", the deployed CSS has the rule, and `docs (Preview)` passed (run 41756864792). - `node -e "import('./next.config.mjs')…"` resolves `experimental.turbopackFileSystemCacheForBuild: false` through `withStory(withMDX(...))`. - This PR's own `docs (Preview)` covers the setting on Vercel. ## Release notes / changeset - No changeset required — no shipped behavior changed. ## Notes - `apps/website` also runs Next 16.4 on Vercel with the same default and could serve stale output the same way. Left out to keep this change to the docs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 8f490a4 commit a05dffc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎apps/docs/next.config.mjs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ const config = {
6262
// service worker the package ships beside itself
6363
// (app/docs/mock-service-worker.js).
6464
serverExternalPackages: ["@zitadel/api-mock"],
65+
experimental: {
66+
// Next 16.4 keeps Turbopack's build cache in .next/cache, which Vercel
67+
// restores from an earlier deployment; a preview built from it served a
68+
// stale app/global.css that lacked a rule its source had. Every build
69+
// compiles from source.
70+
turbopackFileSystemCacheForBuild: false,
71+
},
6572
// Adds each prerendered page's enforced policy, with its inline
6673
// scripts' hashes, once the build has written the page.
6774
adapterPath: fileURLToPath(new URL("./csp-adapter.mjs", import.meta.url)),

0 commit comments

Comments
 (0)