ChunkLoadError 🟨 JavaScript

ChunkLoadError: Loading chunk 123 failed.

A lazily loaded JavaScript chunk couldn’t be downloaded — usually because a new deployment removed the old hashed files.

Seen on: JavaScript

Meaning

Users with an open tab still reference old chunk filenames. After deploy those files are gone (404), so dynamic imports fail. Network blips and ad blockers can also cause it.

Common causes

  • New deploy deleted old hashed chunks
  • CDN/cache serving stale index.html
  • Network failure
  • Wrong publicPath/base for chunks

⚡ Quick fix

  1. Keep previous build assets for a while after deploys
  2. Catch the error and reload the page once
  3. Set publicPath/base correctly

Detailed fix by platform

JavaScript

  1. window.addEventListener('vite:preloadError', () => window.location.reload());

How to diagnose

  1. Chunk URL — Does it 404?
  2. Timing — Right after a deploy?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.