Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esbuild sometimes produces chunks with same hashes but different contents #1076

Closed
iamakulov opened this issue Mar 28, 2021 · 4 comments · Fixed by #1135
Closed

esbuild sometimes produces chunks with same hashes but different contents #1076

iamakulov opened this issue Mar 28, 2021 · 4 comments · Fixed by #1135

Comments

@iamakulov
Copy link

While investigating into #1075, I stumbled upon a chunk with the same hash but different content. The only difference between chunks was the name of the dynamic import:

Screen Shot 2021-03-28 at 17 48 07

Unlike #1075 which simply worsens cacheability, this might break a live app if the developer deploys a new version where ./exportSandbox.K6EQ6MKU.js is no longer present.

Would a repro for this be useful? I believe a minimal reproducible repro for this would also be hard to compose (it reproduces on the Framer codebase – but not with every build config), but I could try.

@evanw
Copy link
Owner

evanw commented Mar 28, 2021

Would a repro for this be useful? I believe a minimal reproducible repro for this would also be hard to compose (it reproduces on the Framer codebase – but not with every build config), but I could try.

Yes it would be very useful as I can't reproduce this either. Although it could turn out that this is the same underlying issue as #1075, so we should probably just try to solve one of them first if this is a lot of work.

@GoodForOneFare
Copy link

GoodForOneFare commented Apr 8, 2021

I may have run into a similar bug. Here's a repo that demonstrates what I'm running into: https://github.com/GoodForOneFare/esbuild-hashing-test

(I can raise a new issue if this is a new bug)

@evanw
Copy link
Owner

evanw commented Apr 11, 2021

Thanks for the test case. It looks like the cause of this is just that the chunk dependency traversal was only following static imports, not dynamic imports. Sorry about that. This will be fixed to follow dynamic imports as well, so they will also be included in the hash in the next release.

@GoodForOneFare
Copy link

Just confirming that the latest version works in our real world app 👍 Thanks for this, and for esbuild in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants