ErrorBellFree

Error library / this error

How to fix it

ChunkLoadError: Loading chunk 123 failed.

What it means

A lazy-loaded piece of your app could not be downloaded. It usually appears right after you deploy a new version.

Common causes

  • The user has the old app open, and the old chunk files were deleted by the new deploy.
  • A cache or CDN served an outdated index with new file names (or the reverse).
  • The network dropped during the download.
  • The public path is wrong, so chunks are requested from the wrong URL.

How to fix it

1. Reload once on chunk errors

A fresh load fetches the new file names.

window.addEventListener('error', (e) => {
  if (/Loading chunk|dynamically imported module/.test(e.message)) location.reload();
});

2. Keep old assets for a while after a deploy

Do not delete the previous build immediately. Give users time to move over.

3. Never cache the HTML entry page

Cache hashed assets for a long time, but serve index.html with no-cache.

Catch it the moment it happens

ErrorBell shows a dot on the page when this error occurs and takes you to the failing line, so you do not have to hunt through the console. Add it to Chrome, it is free.

Related errors