Skip to content

FlashcardNot attempted

Fixes for version skew, by layer

Recall it before you reveal

List the defences against chunk load failures after a deploy, and where each one lives.

Space to reveal
Show answer & explanation
  • Hosting: keep old hashed assets for a while instead of deleting them (they never collide with new names), or use the platform's support for it, e.g. Vercel Skew Protection. Prevents the 404.
  • Detection: poll a version.json (or read a version header) and make the next navigation a full page load, so users move over before they hit an old chunk.
  • Loader: retry a failed import() a couple of times. This helps with network blips; it can't fix a file that no longer exists.
  • Global handler: on vite:preloadError (webpack: a ChunkLoadError), reload once, guarded by a timestamp in sessionStorage so a broken deploy can't cause a reload loop.
  • UI: an error boundary around the routes shows "A new version is available — Refresh" instead of a blank screen.