Originally published on gregale.dev . I build Gregale, so read this as a vendor's page. This post was written with AI assistance.
If Vite reports “Failed to fetch dynamically imported module” after a deploy, inspect the failed request before changing your cache settings. If an old tab is asking for a hashed JavaScript file that the new release no longer serves, keep the file available at its original URL. Serve HTML with Cache-Control: no-cache so new navigations revalidate it. Revalidating HTML alone does not update a page that is already open.
Download the runnable Vite example
1. Check which request actually failed
Open the browser’s Network panel and click the route that fails. Compare the failed asset with the JavaScript named by the current build.…