-
-
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
Async import from both worker and child worker: 'Cannot find module' #5504
Labels
Milestone
Comments
Another case that might be caused by the same problem:
<script src="index.js"></script> // index.js
new Worker("./ParcelWorker.js");
// ParcelWorker.js
import './Parcel';
import("./async.js").then((v) => console.log("worker: async=", v));
// async.js
console.log("async");
export const async = "async!";
// Parcel.js
import WorkerFarm from './Worker';
// Worker.js
import "./common.js";
if (Date.now() === 0) {
new Worker("./child.js");
}
// common.js
(some large file to trigger this becoming a shared bundle: 20kb)
// child.js
import "./Parcel"; |
I'm also able to trigger this with normal module imports: https://github.com/lgarron/parcel-2-worker-common-import The |
lgarron
added a commit
to cubing/jsss
that referenced
this issue
Dec 23, 2020
We're only vendoring right now to work around Parcel 2 bugs like parcel-bundler/parcel#5504
devongovett
added a commit
that referenced
this issue
Jul 11, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 bug report
Doing async imports in nested workers doesn't work beacuse
./loaders/worker/js-loader
isn't available in the inner worker.😯 Current Behavior
💁 Possible Solution
This is probably because the context is actually the same between main and child worker, so Parcel thinks it can reuse the asset from a parent bundle?
💻 Code Sample
parcel build index.html --no-scope-hoist
🌍 Your Environment
The text was updated successfully, but these errors were encountered: