Auto reload page when chunk assets are not found
See original GitHub issueReferences: #6639
We had this feature in Nuxt 2. Basically what happens is with a new deployment, hashes of old js chunks will be changed. And if users already loaded the page with manifest and chunks of the last deployment, they fail when navigating on client-side that tries to load dynamic chunks.
There are several ways to resolve this issue but probably the safest and easiest, is that same as Nuxt 2 we make use of a global error handler that identifies such errors and reload pages. (Note for implementation: We should set a LocalStorage key to avoid infinity page reloads)
Bonus: We could new offer a new nuxtApp
hook such as app:chunkError
that allows graceful HMR alike handling by end-user.
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:14
Top Results From Across the Web
Auto-reload page when Webpack chunks are outdated
If a user has the app open and tries to navigate to a page that is supposed to load an outdated chunk, part...
Read more >How to Solve the Chunk Load Error in JavaScript - Rollbar
Whenever there's an error observed in dynamically fetching helper JavaScript files known as Chunks, a ChunkLoad Error is thrown.
Read more >Webpack from Nothing - Auto-reload Code When You Change It
Auto -reload Code When You Change It. We've got all the right tools in places to build, manage, test, deploy, and debug our...
Read more >Why webpack-dev-server Live-Reload Is Not Working - Medium
When I modify javascript files, I have to manually run Webpack CLI to see changes to bundle.js in the local filesystem, and bundle.js...
Read more >Refreshing the Asset Database - Unity - Manual
It looks for changes to the Asset files, and then updates the source Asset Database · It imports and compiles code-related files such...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I hope to raise the priority of this function, For any enterprise adopting nuxt in the production environment, they does not want to see a page with all styles lost when the user opens the browser for the first time after each new deployment. Thanks @pi0
I’m so glad this has come up again! I didn’t realize it had been mentioned before because I’ve actually just discovered this issue and it has caused a huge pain for me and my users. Getting some eyes on this issue would be hugely appreciated 🙏