Issue with stale [chunkhash] referencing old [contenthash] #78750
Unanswered
MartinDavi
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
This is the relevant config from next's webpack.config.js
You can see that in appDir, chunks are generated using
chunkhash
(thefilename
property). But chunks from dynamically imported files are usingcontenthash
(thechunkFilename
property).So what I'm seeing is after updating next.js from 15.2.5 to 15.3.0, one of our dynamic chunks has been minified / uglified differently even though the source code hasn't changed. So it gets a new filename, because
contenthash
must be computed from the content of the compiled file (this is a guess, but since it's a component from an npm package, and we didn't update that package, the source code must be the same).Now, our
webpack-[chunkhash].js
doesn't get a new filename even though it's now referencing the new filename of the chunk. And because it is cached forever, pages break as people that already havewebpack-[chunkhash].js
cached in their browser are trying to fetch non-existant chunks from our server.This seems really bad? Why is only appDir using
[chunkhash]
- using[contenthash]
everywhere would solve this.15.2.5:

15.3.0:

And that
webpack-[chunkhash].js
content has changed to reference the new filename for the youtube react player chunk.Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions