profile
viewpoint

Ask questionsRoute based code splitting, Loading chunk 0 failed after new deployment

We are using Suspense and route based code splitting with react 16. This uses Webpack chunks to split the code into smaller bits for different routes in the application. In production mode this produces chunks with a hash named something like 7.8817be1b.chunk.js.

The issue is that when we deploy a new production release users with the app open who client side navigate to a page requiring a new chunk get an error (they have the old bundle, so they are requesting an old no-longer existing chunk).

We are not too sure how to deal with this error, does react have any guidance around what we should do with existing users who are requesting old chunks? Can some guidance about this be added to the docs: https://reactjs.org/docs/code-splitting.html

React: 16.12.0

facebook/react

Answer questions aweary

We try to use this issue tracker for bug reports and feature requests for React only. While this may be an issue you encounter following the official guidance on the React website, it doesn't mean that it's a problem with React itself. As @threepointone said, this is a problem that occurs with bundling and code-splitting in general. I recommend checking out the list of great support resources listed on the doc page, Where to Get Support.

useful!

Related questions

Disable react strict mode on third party libraries hot 6
Refs - "object is not extensible" hot 4
Warning: Unknown DOM property for. Did you mean htmlFor? hot 4
React@16.9 block `javascript:void(0);` hot 4
TypeError: Object(...) is not a function hot 3
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table> hot 3
React custom hook "Should have a queue. This is likely a bug in React" error message. hot 2
useEffect causes 'callback is not a function' exception hot 2
DevTools: Updating state or props in devtools does not trigger component update. hot 2
Infinite loop in useEffect using blank object or array hot 2
False-positive security precaution warning (`javascript:` URLs) hot 2
Hooks API - hook breaks when exported from module hot 2
Function components do not support contextType. hot 2
Feedback on useEffect depndencies change error hot 2
Should have a queue. This is likely a bug in React. Please file an issue hot 2
Github User Rank List