-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] Transitive dependencies must follow the top level project's nodeLinker setting #1167
Comments
@molst Thank you for opening this issue. If you are using pnp library from node_modules, you can make this pnp library interoperable for calls from node_modules by having separate entry point which just requires |
This is certainly not an expected behaviour and hence this issue is not a bug. Yarn must not add/modify files outside of |
Alright, I think I understand what you mean, but to make sure, do you have some example of how to accomplish this? I tried what I suppose should be the simplest thing following your guidance which was to to add this at the top of the file I'm trying to load, which is vectors.mjs (see below). Unfortunately without luck so far.. (I have to load require because I'm using ES modules):
I'm using this kind of exports declaration in package.json
|
To be fair I have hard time understanding what your setup is, as this issue didn't mention MJS initially. My recommendation was about requiring commonjs pnp modules from commonjs node modules. |
@molst Please put exact reproduction steps in your issues. Anything harder than cloning a repository and running two commands increases the number of back and forth required 🙂 The issue template even mentions a tool called Sherlock that we strongly recommend for issues opened against this repository, precisely for this reason. |
That's totally understandable! Thanks for your fast response. |
Expected behavior
When using the
portal
protocol, all transitive dependencies should resolve using their localnodeLinker
setting.Current behavior
When the top level dependency uses
node-modules
, linking fails at the top level when a referenced library uses the default PnP resolution.Notes
nodeLinker: node-modules
setting in my top level project due to this issue. This means that all my libraries also have to fall back to usingnode-modules
.ERR_MODULE_NOT_FOUND
when referencing the sub project.The text was updated successfully, but these errors were encountered: