-
-
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
fix: use require.resolve when resolving default config #5127
fix: use require.resolve when resolving default config #5127
Conversation
|
cc @padmaia |
I think we actually want to try |
Are there any advantages to using |
Generally, I didn't know about the |
Apparently even Flow doesn't know about that option:
Can you add a |
Done! Apparently the Flow server in VSCode decided to take a nap while I was developing. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for @padmaia to double check...
↪️ Pull Request
2.0.0-nightly.396
regressed PnP support in #4927, by not usingrequire.resolve
to load thedefaultConfig
-@parcel/config-default
: https://github.com/parcel-bundler/parcel/pull/4927/files#diff-57d3138ed35ffa967c184c701e6efea4R181.Yarn's E2E tests caught this issue after
2.0.0-nightly.396
was released: https://github.com/yarnpkg/berry/runs/1097463270?check_suite_focus=true#step:5:157.This was solved by using
require.resolve
to resolve@parcel/config-default
, which causes it to be resolved on behalf ofparcel
. I can confirm that this change fixes the issue.💻 Examples
Expected: Build should succeed.
Got:
Error: Cannot find module '@parcel/config-default'
🚨 Test instructions
Parcel's PnP test didn't catch this because it goes through
@parcel/test-utils
instead of the CLI. I've looked a bit into Parcel's testing infrastructure, but I couldn't find tests testing the actual CLI (In case they exist, I'd be happy to add a basic PnP CLI test).✔️ PR Todo