You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run nx build api the output bundles all of the npm packages into the output. It does generate a package.json in the output, but it does not populate the dependencies field.
Expected Behavior
The build output should not contain npm packages. It should only bundle my code, and it should populate the dependencies field.
GitHub Repo
No response
Steps to Reproduce
Use @nx/js to generate an app
Use any external npm module (example: use firebase-admin and simply call initializeApp() in index.js
build the app (using @nx/esbuild) and check the output
Please note that while nx report mentions that the pnpm version 8.15.7, this report was generated after I reverted to pnpm v8. The problem actually occured on pnpm v9.
I placed a breakpoint inside of @nx/esbuild, inside a function called getExtraDependencies. When using pnpm@9, the externalDependencies array was empty. When using pnpm@8, it was populated with the proper dependencies.
The value of this externalDependencies array was affecting the output generated by esbuild.
I think nx is not yet compatible with pnpm@9. The actual issue probably resolves around the pnpm-lock.yaml. pnpm@8 uses lockfile version 6 and pnpm@9 uses lockfile version 9.
The text was updated successfully, but these errors were encountered:
Current Behavior
Following is a part of the configuration for a node.js api project
When I run
nx build api
the output bundles all of the npm packages into the output. It does generate apackage.json
in the output, but it does not populate the dependencies field.Expected Behavior
The build output should not contain npm packages. It should only bundle my code, and it should populate the dependencies field.
GitHub Repo
No response
Steps to Reproduce
initializeApp()
in index.jsNx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
Please note that while nx report mentions that the pnpm version 8.15.7, this report was generated after I reverted to pnpm v8. The problem actually occured on pnpm v9.
I placed a breakpoint inside of @nx/esbuild, inside a function called
getExtraDependencies
. When using pnpm@9, theexternalDependencies
array was empty. When using pnpm@8, it was populated with the proper dependencies.The value of this externalDependencies array was affecting the output generated by esbuild.
I think nx is not yet compatible with pnpm@9. The actual issue probably resolves around the
pnpm-lock.yaml
. pnpm@8 uses lockfile version 6 and pnpm@9 uses lockfile version 9.The text was updated successfully, but these errors were encountered: