-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 subpath imports with Yarn PnP #2547
Conversation
71f42ec
to
04a3f20
Compare
04a3f20
to
421813a
Compare
Heads up: yarnpkg/berry#3843 was fixed in yarnpkg/berry#4862 |
I tried updating to Yarn
This happens because GitHub Actions puts the repo on the It looks like I need to wait for this issue to be fixed in a future release of Yarn before landing this change. Edit: This is the same part of the package manifest from Yarn 3.2.3 for reference. This one works fine because it's located on the same drive:
|
It looks like maybe Yarn 4 changed the default of |
It works in Yarn because internally it treats it as a posix path where there are no such limitations, it only turns it into a win32 path when passing it to the |
Node has a little-used feature called subpath imports which are package-internal imports that start with
#
and that go through theimports
map inpackage.json
. Previously esbuild had a bug that caused esbuild to not handle these correctly in packages installed via Yarn's "Plug'n'Play" installation strategy. The problem was that subpath imports were being checked after Yarn PnP instead of before. This PR reorders these checks, which should allow subpath imports to work in this case.Note: Tests are currently failing due to a bug in Yarn itself: yarnpkg/berry#3843. This PR is blocked on that bug being fixed.
Fixes #2545