Error AtlasError Documentation and Resolution

Vite app failed to fetch a dynamically imported module

TypeError: Failed to fetch dynamically imported module

A Vite-built app tried to load a dynamic import chunk that was unavailable, blocked, or mismatched with the currently cached HTML.

TypeError: Failed to fetch dynamically imported moduleruntime
TypeError: Failed to fetch dynamically imported module
  • The browser cached an older HTML file that still references deleted chunk names after a new deployment.
  • The network request for the chunk failed.
  • A browser extension blocked the dynamically imported module request.
  1. Open browser developer tools and inspect the failed JavaScript request in Network. Record its URL, status, and response body before clearing caches. A 404, an HTML response, and a blocked request need different fixes.
  2. If an old tab requests a chunk removed by a deployment, refresh to obtain the current application version. Keep previous hashed assets available during a deployment transition, and configure HTML to revalidate rather than caching it indefinitely.
  3. If the request returns HTML instead of JavaScript, check asset paths and hosting rewrites. A fallback that serves index.html for a missing chunk hides the missing file behind a successful HTTP status.
  4. If deploying under a subdirectory, verify Vite's base setting matches the public asset path and that the requested chunk was uploaded.
  5. Use vite:preloadError to offer recovery when an import fails. Avoid an unconditional reload loop: a persistent outage or blocked request will not be repaired by repeatedly refreshing.
  6. Retest with a clean browser profile to isolate extension blocking. Verify both a fresh load and navigation from a tab left open across a deployment.
Vite: Load Error Handling