Bug report
What is the current behavior?
When running the watch command, at some point the runtime-app chunk referenced in the app chunk is different from the one referenced in the asset-manifest.json.
Since we load this code in a PHP app, we use the manifest to load the chunks dynamically.
Having the manifest reference a different chunk than the one referenced in the app chunk means that the browser loads two different runtime-app chunks, one requested by the manifest, and the other by the app chunk.
Since the second one is the oldest, the end result is that the watch command is not doing its job, because from a certain moment, I'm not able to see the changes I make to the code reflected in the browser.
If the current behavior is a bug, please provide the steps to reproduce.
Here is a GitHub repository with the code needed to reproduce the issue: https://github.com/gtempesta/webpack-issue-repro/.
How to reproduce:
- Clone the repository
- Run
npm install to install the dependencies
- Run
npm run watch to start watching for changes
- Open the
asset-manifest.json file in the public folder, and open the app chunk that is referenced in the entry-points field. Now look for the runtime-app chunk in the app chunk and check that it's the same that is referenced in the asset-manifest.json file: it should be the same (with the same hash)
- Make a change to the code in
app.js and save it
- The issue is still not there
- Now make a change to the
design-area.js file and save it
- The issue should be there now: the
runtime-app chunk in the asset-manifest.json file and in the app chunk should have different hashes
The issue happens only when using the watch command, and not when using the build command (which is not implemented in this repo).
What is the expected behavior?
I would expect that the runtime-app chunk referenced in the asset-manifest.json file and in the app chunk are always the same, so that I can use the manifest to load the chunks dynamically without having to worry about which one is loaded.
Other relevant information:
webpack version: 5.99.5
Node.js version: 18.17.1
Operating System: macOS Sequoia 15.3.2
Additional tools:
Bug report
What is the current behavior?
When running the
watchcommand, at some point theruntime-appchunk referenced in theappchunk is different from the one referenced in theasset-manifest.json.Since we load this code in a PHP app, we use the manifest to load the chunks dynamically.
Having the manifest reference a different chunk than the one referenced in the
appchunk means that the browser loads two differentruntime-appchunks, one requested by the manifest, and the other by theappchunk.Since the second one is the oldest, the end result is that the
watchcommand is not doing its job, because from a certain moment, I'm not able to see the changes I make to the code reflected in the browser.If the current behavior is a bug, please provide the steps to reproduce.
Here is a GitHub repository with the code needed to reproduce the issue: https://github.com/gtempesta/webpack-issue-repro/.
How to reproduce:
npm installto install the dependenciesnpm run watchto start watching for changesasset-manifest.jsonfile in the public folder, and open theappchunk that is referenced in theentry-pointsfield. Now look for theruntime-appchunk in theappchunk and check that it's the same that is referenced in theasset-manifest.jsonfile: it should be the same (with the same hash)app.jsand save itdesign-area.jsfile and save itruntime-appchunk in theasset-manifest.jsonfile and in theappchunk should have different hashesThe issue happens only when using the
watchcommand, and not when using thebuildcommand (which is not implemented in this repo).What is the expected behavior?
I would expect that the
runtime-appchunk referenced in theasset-manifest.jsonfile and in theappchunk are always the same, so that I can use the manifest to load the chunks dynamically without having to worry about which one is loaded.Other relevant information:
webpack version: 5.99.5
Node.js version: 18.17.1
Operating System: macOS Sequoia 15.3.2
Additional tools: