loadable-components and webpack 5, incorrect content hashes in the stats file
See original GitHub issue🐛 Bug report
Current Behavior
yarn create razzle-app --example with-loadable-components my-project
cd my-project
yarn add --dev webpack@5.24.0 html-webpack-plugin@5.2.0
yarn build
The build/loadable-stats.json
content hashes do not align with the corresponding files’ content hashes.
Expected behavior
The loadable-stats.json
content hashes align with the corresponding files’ content hashes.
Reproducible example
Suggested solution(s)
I’m assuming the issue involves the webpack config generated by razzle, but I am unsure.
Additional context
To confirm that it was not an issue with loadable-components and webpack 5, I created a minimal webpack.config.js
in the project and was able to successfully compile the chunks with proper content hashes.
The example repo works properly with webpack 4.
Your environment
Software | Version(s) |
---|---|
Razzle | 4.0.3 |
Razzle Plugins | N/A |
Node | v14.15.0 |
Browser | N/A |
Yarn | 1.22.10 |
Operating System | macOS 10.15.7 |
TypeScript | N/A |
React | 17.0.1 |
Webpack | 5.24.0 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Server Side Rendering
This is the stats file generated by webpack loadable plugin. const statsFile = path.resolve('../dist/loadable-stats.json').
Read more >loadable/componet not loading on server side rendering
json file is created with chunk hash values. What am I doing wrong here? javascript · reactjs · react-router · loadable-component.
Read more >Caching
This guide focuses on the configuration needed to ensure files produced by webpack compilation can remain cached unless their content has changed.
Read more >Webpack 5 release (2020-10-10)
Webpack 5 will use a real hash of the file content when using [contenthash] now. Before it "only" used a hash of the...
Read more >Resolve
import Test1 from 'xyz'; // Exact match, so path/to/file.js is resolved and ... null-loader is deprecated in webpack 5. use alias: { xyz$:...
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
No results found
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
This is a bug in loadable-components’s webpack plugin which is fixed in their main branch but still unreleased. See https://github.com/gregberge/loadable-components/issues/712
Fixed