-
-
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
tree shaking used in async modules, not found module #2804
Comments
Happens for me with this: <script src="./index.js"></script> // index.js
import("./a.js").then(() => {});
import("./b.js").then(() => {});
// a.js
import("./c.js").then(v => console.log("a", v.default));
// b.js
import("./c.js").then(v => console.log("b", v.default));
// c.js
export default 123; |
I'd say this is once again caused by Parcel's deduplication of assets. |
That's it! parcel/packages/core/parcel-bundler/src/Bundler.js Lines 647 to 656 in cbccd25
|
@devongovett This would require quite a deep change (removing the duplicate assets/bundles only at a later stage). Will this be easier with Parcel 2? |
Should be fixed with Parcel 2 |
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
💻 Code Sample
😯 Current Behavior
When the js resource is loaded in the browser order
main.js b.js
, then throw NOT FOUND KQUI module error.🤔 Expected Behavior
If you are loading modules asynchronously, you should also keep information about their assetsDeps.
💁 Possible Solution
https://github.com/parcel-bundler/parcel/blob/parcel-bundler%401.12.1/packages/core/parcel-bundler/src/scope-hoisting/concat.js#L201
🔦 Context
🌍 Your Environment
The text was updated successfully, but these errors were encountered: