-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Bug?]: PnP can not resolve module on dts #5287
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
Comments
It works with node-modules https://github.com/flex-jonghyen/pnp-reproduce/tree/node-module |
I add another case on reproduce repository |
@arcanis I have been waiting for a response for two weeks, but I have not heard anything. If you could please let me know of any entry that could help solve this issue, I would be happy to investigate it. I will await your response. |
@arcanis I have the same issue. Can i get a response on this issue? 🙏 |
I updated the issue with more details. |
This looks like a bug in TypeScript, It's emitting imports for dependencies that aren't declared.
That reproduction also shows the same issue, the reason it works is because of hoisting.
This is the expected behaviour, if a dependency isn't declared PnP wont let you access it. |
Finally! Thank you for your answer. I understand that you're saying the output method of TypeScript's .dts files does not fit well with yarn's strict dependency resolve approach. I will look into finding a solution in TypeScript. |
Uh oh!
There was an error while loading. Please reload this page.
Self-service
Describe the bug
Updated: 23.03.29
I'm in the following situation: I have 3 packages, A, B, and C, with dependencies in the order of A -> B -> C.
Package A exports the following code (this is part of the actual code):
Package B uses createThemedStyled from package A:
Finally, package C uses styled from package B:
After building each package and generating their dts, the output for package C's dts looks like this:
However, it seems that in pnp, if package C doesn't explicitly have package A as a dependency, A cannot be resolved. This works correctly with nodeLinker: node-modules.
And I don't think this issue is tied to a specific library or the TypeScript compiler.
This issue seems to occur only in the dts, and adding package A to the devDependencies of the problematic package C resolves the issue.
The log is part of result of
tsc --traceResolution
about C package.To reproduce
https://github.com/flex-jonghyen/pnp-reproduce
Environment
System: OS: macOS 13.2.1 CPU: (10) arm64 Apple M1 Max Binaries: Node: 16.18.0 - /private/var/folders/ld/_l4gwlwn2j1fxtlp_mpc5xr00000gn/T/xfs-e9ba9998/node Yarn: 3.2.3 - /private/var/folders/ld/_l4gwlwn2j1fxtlp_mpc5xr00000gn/T/xfs-e9ba9998/yarn npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
Additional context
No response
The text was updated successfully, but these errors were encountered: