Webpack Code Splitting 'Loading chunk failed' error wrong file path

That happens because output.publicPath by default is /.

Just update output.publicPath to point where you want it to be => /dist/.


When redeploying, on rebuilding the app bundles make sure NOT to clean the output folder with previous chunk files, because users that already have the app loaded will try to fetch previous chunk files that will not exist anymore.

Best thing to do is to have an app version tracking (using AJAX and read from db or dynamic config file) and when the app detects a newer version, message the user about it and ask them to reload the page.