-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@nx/js
tsc compiler cannot add compiler external helper (tslib) when use pnpm workspace
#17674
Closed
1 of 4 tasks
Comments
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 20, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 20, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 21, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 21, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 21, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
jaysoo
added a commit
to jaysoo/nx
that referenced
this issue
Jun 21, 2023
…ed with version When using pnpm, the version might be added to avoid ambiguity, but it causes the wrong warning when detecting missing helper packages. Closes nrwl#17674
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Behavior
When the package manager
pnpm
is used to manage the workspace dependencies the buildable js libraries cannot add thetslib
as a dependency.This issue is not a blocker because Nx continues and builds the library, however, the generated
package.json
doesn't have thetslib
as a dependency.Expected Behavior
Should not present the warning message and add the
tslib
as a dependency when the workspace uses pnpm to manage the dependencies and the js libraries are built.GitHub Repo
No response
Steps to Reproduce
npx create-nx-workspace@latest pnpm-issue --packageManager pnpm
nx generate @nx/js:library lib1
nx run lib1:build
Nx Report
Failure Logs
Operating System
Additional Information
After some investigation, the
@nx/js
package at https://github.com/nrwl/nx/blob/master/packages/js/src/utils/compiler-helper-dependency.ts#L74,The
helperDependency
contains the valuetslib
, however, the way the external nodes are generated when nx resolves the dependencies from pnpm lock file makes the object have the version in the keys, like this:[ 'npm:[email protected].', 'npm:[email protected].', 'npm:[email protected].' ]
so, the tslib is installed in the workspace, but in multiple versions, even in the most basic workspace, because there are some base packages that use
tslib
as a dependency, like@typescript-eslint/parser
.Which results in multiple versions of the tslib.
I guess the better approach is to try to resolve the tslib version from the project's
package.json
or the rootpackage.json
.The text was updated successfully, but these errors were encountered: