-
-
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
package.json#source
field is used for npm packages with pnpm
#5784
Comments
@mischnic Did you find a workaround for this issue? I'm also trying to load |
I don't think there is a workaround, unfortunately. This is the problematic code parcel/packages/utils/node-resolver-core/src/NodeResolver.js Lines 647 to 654 in f28eaf6
Until pnpm, symlinks meant that you're using a monorepo and you're not importing an npm package but another monorepo package. The condition should probably be adjusted to make pnpm work. |
Maybe something like this? This is very specific to pnpm though. if (realpath === file || realpath.includes('node_modules/.pnpm'))
delete pkg.source; |
Or maybe something like "if it's a symlink and the realpath is inside of the project root" |
Isn't everything in the project root? Unless you meant the node_modules of the project root, that could work. if (realpath === file || realpath.startsWith(path.join(this.projectRoot, 'node_modules')))
delete pkg.source; |
Don't the pnpm symlinks point to a global folder like |
You're right I had to Google around to check. But pnpm works with a content-addressable store
In my case (macOS) the realpath resolved to the location in the virtual store. Not sure if it's the same on a Windows machine. Here's an example of what I get in my project when I simply add a
|
Yes, it's in
I think a I actually use Rush to manage my monorepo, and I have it using pnpm. The final destination for the dependencies is
|
Is there something I can do to help get a fix for this issue? I'm still running into packages that parcel incorrectly tries to resolve using |
For this package specifically, adding |
I made a small Proof-Of-Concept ParcelJS Resolver based on your solution + DefaultResolver, it seems to fix my issues by now: Usage: pnpm i parcel-resolver-pnpm Partial
Here is the project repository: https:/guesant/parcel-resolver-pnpm |
🐛 bug report
When using pnpm, the resolver tries to use the
"source"
field of a package from npm.😯 Current Behavior
🤔 Expected Behavior
Ignore
package.json#source
for npm packages🔦 Context
#5604 (comment)
💻 Code Sample
Use
pnpm install
!🌍 Your Environment
The text was updated successfully, but these errors were encountered: