-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Generated asset id is prone to collisions -- breaking imports #3823
Comments
Parcel 2 uses the full hash, do you have an example where it still fails in this case? |
The link above is for the file in the |
|
Could you please point me to the updated Asset.js from the Parcel 2 then? |
parcel/packages/core/core/src/InternalAsset.js Lines 60 to 65 in 291f3e6
|
Ok, thank you. I updated the issue description. |
Hi @mischnic , I have had the exact same issue. Now fixed by changing a folder name in my project to avoid collision. Could this be fixed in parcel 1? Thx! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. |
🐛 bug report
The asset id generation method used in
parcel/packages/core/parcel-bundler/src/Asset.js
Line 208 in 291f3e6
both of these assets will generate asset id "ToFw". Having different assets with the same id could and does break some applications.
🎛 Configuration (.babelrc, package.json, cli command)
The build should be a production build or have scope hoisting enabled. This affects only Parcel 1.
🤔 Expected Behavior
Asset ids should not have collisions.
😯 Current Behavior
Asset ids collide leading to importing of wrong modules. I.e. importing the
_an-object
results in importing thelodash-es/clone
.💁 Possible Solution
Check if the hash already exists in the cache with the same relative name and use more characters from the full md5 if required.
The text was updated successfully, but these errors were encountered: