Start watching free

Error library · Old tabs after a deploy

Failed to fetch dynamically imported module

When you publish a new version, anyone who already had the app open is still running the old one. Their browser goes to fetch a piece of the page that the new version renamed, does not find it, and that part of the app stops working. Reloading fixes it, but nothing tells them to reload.

Who it affects

People who had the app open while you deployed — 5 sessions so far — hit a blank area or a button that does nothing, with no message explaining why. Everyone who opens the app fresh is unaffected.

Numbers here are from an example app where 5 visitors hit it. How serious: Medium — annoying, and worth fixing soon.

How to fix it

Give this to the AI that builds your app. It’s the prompt Vigilia writes for this error — shown here for an example app (an orders table, a /checkout page); for your app, Vigilia fills in the real details from what your visitors hit.

For Lovable
Bug: after I deploy a new version, visitors who still have the old page open get a broken screen. The browser requests a JavaScript chunk that the previous build produced and the new build no longer has, the dynamic import fails, and whatever needed that chunk never renders. The user is shown nothing.

Evidence: "TypeError: Failed to fetch dynamically imported module: https://your-app.com/assets/Checkout-a1b2c3.js", requesting https://your-app.com/assets/Checkout-a1b2c3.js — seen 12 times across ~5 sessions. The filename carries a per-build content hash, which is why it disappears on every deploy.

What to change:
1. Catch the failed dynamic import where lazily-loaded routes and components are loaded, instead of letting it throw and leave the area empty.
2. When it happens, tell the user a new version is available and reload the page once. Guard that reload with a flag that survives the reload (so a file that is genuinely missing can never put the page in a refresh loop).
3. If your host allows it, keep the previous build's files in place for a while after deploying (this app is built with vite), so tabs opened before the deploy can still finish loading.

Acceptance criteria: with the app open in one tab, deploy a new version, then navigate in that tab to a page that loads lazily. It should either load normally or prompt to reload once and then work — never fail silently. No "failed to fetch dynamically imported module" in the console, and no repeated reloading.
For Bolt
Bug: after I deploy a new version, visitors who still have the old page open get a broken screen. The browser requests a JavaScript chunk that the previous build produced and the new build no longer has, the dynamic import fails, and whatever needed that chunk never renders. The user is shown nothing.

Evidence: "TypeError: Failed to fetch dynamically imported module: https://your-app.com/assets/Checkout-a1b2c3.js", requesting https://your-app.com/assets/Checkout-a1b2c3.js — seen 12 times across ~5 sessions. The filename carries a per-build content hash, which is why it disappears on every deploy.

What to change:
1. Catch the failed dynamic import where lazily-loaded routes and components are loaded, instead of letting it throw and leave the area empty.
2. When it happens, tell the user a new version is available and reload the page once. Guard that reload with a flag that survives the reload (so a file that is genuinely missing can never put the page in a refresh loop).
3. If your host allows it, keep the previous build's files in place for a while after deploying (this app is built with vite), so tabs opened before the deploy can still finish loading.

Acceptance criteria: with the app open in one tab, deploy a new version, then navigate in that tab to a page that loads lazily. It should either load normally or prompt to reload once and then work — never fail silently. No "failed to fetch dynamically imported module" in the console, and no repeated reloading.
For Cursor
Bug: after I deploy a new version, visitors who still have the old page open get a broken screen. The browser requests a JavaScript chunk that the previous build produced and the new build no longer has, the dynamic import fails, and whatever needed that chunk never renders. The user is shown nothing.

Evidence: "TypeError: Failed to fetch dynamically imported module: https://your-app.com/assets/Checkout-a1b2c3.js", requesting https://your-app.com/assets/Checkout-a1b2c3.js — seen 12 times across ~5 sessions. The filename carries a per-build content hash, which is why it disappears on every deploy.

What to change:
1. Catch the failed dynamic import where lazily-loaded routes and components are loaded, instead of letting it throw and leave the area empty.
2. When it happens, tell the user a new version is available and reload the page once. Guard that reload with a flag that survives the reload (so a file that is genuinely missing can never put the page in a refresh loop).
3. If your host allows it, keep the previous build's files in place for a while after deploying (this app is built with vite), so tabs opened before the deploy can still finish loading.

Acceptance criteria: with the app open in one tab, deploy a new version, then navigate in that tab to a page that loads lazily. It should either load normally or prompt to reload once and then work — never fail silently. No "failed to fetch dynamically imported module" in the console, and no repeated reloading.
For Claude Code
Bug: after I deploy a new version, visitors who still have the old page open get a broken screen. The browser requests a JavaScript chunk that the previous build produced and the new build no longer has, the dynamic import fails, and whatever needed that chunk never renders. The user is shown nothing.

Evidence: "TypeError: Failed to fetch dynamically imported module: https://your-app.com/assets/Checkout-a1b2c3.js", requesting https://your-app.com/assets/Checkout-a1b2c3.js — seen 12 times across ~5 sessions. The filename carries a per-build content hash, which is why it disappears on every deploy.

What to change:
1. Catch the failed dynamic import where lazily-loaded routes and components are loaded, instead of letting it throw and leave the area empty.
2. When it happens, tell the user a new version is available and reload the page once. Guard that reload with a flag that survives the reload (so a file that is genuinely missing can never put the page in a refresh loop).
3. If your host allows it, keep the previous build's files in place for a while after deploying (this app is built with vite), so tabs opened before the deploy can still finish loading.

Acceptance criteria: with the app open in one tab, deploy a new version, then navigate in that tab to a page that loads lazily. It should either load normally or prompt to reload once and then work — never fail silently. No "failed to fetch dynamically imported module" in the console, and no repeated reloading.
For any other tool
Bug: after I deploy a new version, visitors who still have the old page open get a broken screen. The browser requests a JavaScript chunk that the previous build produced and the new build no longer has, the dynamic import fails, and whatever needed that chunk never renders. The user is shown nothing.

Evidence: "TypeError: Failed to fetch dynamically imported module: https://your-app.com/assets/Checkout-a1b2c3.js", requesting https://your-app.com/assets/Checkout-a1b2c3.js — seen 12 times across ~5 sessions. The filename carries a per-build content hash, which is why it disappears on every deploy.

What to change:
1. Catch the failed dynamic import where lazily-loaded routes and components are loaded, instead of letting it throw and leave the area empty.
2. When it happens, tell the user a new version is available and reload the page once. Guard that reload with a flag that survives the reload (so a file that is genuinely missing can never put the page in a refresh loop).
3. If your host allows it, keep the previous build's files in place for a while after deploying (this app is built with vite), so tabs opened before the deploy can still finish loading.

Acceptance criteria: with the app open in one tab, deploy a new version, then navigate in that tab to a page that loads lazily. It should either load normally or prompt to reload once and then work — never fail silently. No "failed to fetch dynamically imported module" in the console, and no repeated reloading.

Vigilia catches this automatically

When this happens on your live app, Vigilia recognises it at once — no waiting, no AI credits — tells you who it affects, hands your AI the fix, and confirms it held with real visitors.

More errors, explained