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

Parcel 2: Workers interaction w/ Yarn 2 #3390

Closed
arcanis opened this issue Aug 14, 2019 · 0 comments
Closed

Parcel 2: Workers interaction w/ Yarn 2 #3390

arcanis opened this issue Aug 14, 2019 · 0 comments

Comments

@arcanis
Copy link
Contributor

arcanis commented Aug 14, 2019

🐛 bug report

It's really more of a Node issue than a Parcel one tbh, but I think it should be tracked on both repositories, if only for better discoverability 🙂

Parcel 2 currently hangs when used with a Yarn 2 project because the workers are executed outside of the PnP context (because of nodejs/node#29117), and the error isn't properly cascaded back to the master process.

💁 Possible Solution

Apart from fixing this in Node, the alternative would be to:

  • Manually send the script content using the eval option from new Worker, to avoid the crash when Node tries to read the in-zip file outside of the PnP context (it would work since the master thread can call readFile on its own files without problem).

  • Forward the PnP path when detecting that the process is executing under a PnP environment (ie when the pnpapi name can be successfully resolved), so that the child thread can setup its own environment (ie call require(workerData.pnpPath).setup()).

Or to disable the workers codepath when detecting PnP (the process workers seem to work, as they spawn a new process which properly executes the --require entries), but that would be a shame.

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

No branches or pull requests

3 participants