Repository navigation
fix(website): prevent blank pages after in-place redeployment - #113
Merged
Merged
Conversation
Next.js 15.5.27 copies prerendered pages to .next/server/route-cache at runtime and serves that copy before the build's own output. In-place deployments keep these files, so after the next deployment pages reference static chunks that no longer exist and render blank. Disable writing the incremental cache to disk.
Sites already affected keep serving the stale copies even after the cache stops being written. Delete .next/server/route-cache when the Node.js server starts.
Lucki2g
approved these changes
Oct 7, 2026
Lucki2g
left a comment
Contributor
There was a problem hiding this comment.
Virkede at slette cache direkte via SSH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since the Next.js upgrade to 15.5.27, sites that are redeployed in place (the nightly App Service pipeline) can show a blank white page after a deployment. The browser console shows 404s for
/_next/static/chunks/webpack-*.jsand "Refused to execute script … MIME type ('text/plain')".Next.js 15.5.27 (and 16.x) copies prerendered pages to
.next/server/route-cache/the first time they are requested, and serves that copy before the build's own prerendered output. The copy is not keyed by build. A zip deployment only replaces packaged files, so the copies survive the next deployment and app restarts. After the next build, pages such as/logincome from the previous build and reference chunk hashes that no longer exist.Only sites with a page request between two deployments break, so rarely used installations keep working until they are used.
Fix
next.config.ts: setexperimental.isrFlushToDisk: false, so the incremental cache is no longer written to disk. Pages are still prerendered at build time and cached in memory. Data Model Viewer rebuilds for every metadata refresh, so the on-disk cache gives no benefit.instrumentation.ts: when the Node.js server starts, remove.next/server/route-cache. Without this, sites that are already affected keep serving the stale copies after updating, because existing files are still read.Validation
Reproduced locally by simulating nightly pipeline runs: production build, packaging the standalone output as in
Setup/azure-pipelines-build-jobs.yml, then a zip-deploy-style overwrite that keeps runtime-created files, followed by a restart. Used synthetic sample metadata and Node 22.23.2.main, second deployment/loginserved the first build's HTML.webpack-*.jsreturned 404 and the page was blank.main, after redeploy)Website lint and production build passed (existing warnings only).