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
If you try to run a NestJS app with nx in combination with yarn v3 in pnp mode, you get a bunch of errors during build about incorrect dependency resolution. This does not happen when running a NestJS app with yarn v3 without nx.
Expected Behavior
I expect the NestJS app to build successfully with this combination of tools. Yarn v3 with pnp as the nodeLinker is giving us great benefits during local & CI builds.
hunk (runtime: main) main.js (main) 1.9 MiB (javascript) 793 bytes (runtime) [entry] [rendered]
WARNING in ../../.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/utils/load-package.util.js 9:39-59
Critical dependency: the request of a dependency is an expression
WARNING in ../../.yarn/cache/express-npm-4.18.2-bb15ff679a-3c4b9b0768.zip/node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/concat.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/concat.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/concat.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/filter.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/filter.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/filter.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/flatten.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/flatten.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/flatten.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/index.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/index.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/index.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/iterate.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/iterate.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/iterate.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/map.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/map.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/map.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/slice.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/slice.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/slice.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/utils.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/utils.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/utils.ts'
WARNING in ../../.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/lib/zip.js
Module Warning (from ../../.yarn/__virtual__/source-map-loader-virtual-ffe0e71b95/0/cache/source-map-loader-npm-3.0.2-6e868d7f08-d5a4e2ab19.zip/node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/cache/iterare-npm-1.2.1-b666309be8-70bc80038e.zip/node_modules/iterare/src/zip.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/iterare/src/zip.ts'
WARNING in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/helpers/load-adapter.js 9:39-63
Critical dependency: the request of a dependency is an expression
WARNING in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/helpers/optional-require.js 6:39-59
Critical dependency: the request of a dependency is an expression
ERROR in ../../.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/cache/cache.providers.js 17:108-132
Module not found: Error: @nestjs/common tried to access cache-manager (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.Required package: cache-managerRequired by: @nestjs/common@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/cache/)Ancestor breaking the chain: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: @nestjs/testing@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: experiment@workspace:.ERROR in ../../.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/pipes/validation.pipe.js 38:174-200Module not found: Error: @nestjs/common tried to access class-validator (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: class-validator
Required by: @nestjs/common@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/pipes/)
Ancestor breaking the chain: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: @nestjs/testing@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: experiment@workspace:.
ERROR in ../../.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/pipes/validation.pipe.js 41:182-210
Module not found: Error: @nestjs/common tried to access class-transformer (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.Required package: class-transformerRequired by: @nestjs/common@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/pipes/)Ancestor breaking the chain: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: @nestjs/testing@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: experiment@workspace:.ERROR in ../../.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/serializer/class-serializer.interceptor.js 25:244-272Module not found: Error: @nestjs/common tried to access class-transformer (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: class-transformer
Required by: @nestjs/common@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/__virtual__/@nestjs-common-virtual-5682bc52e1/0/cache/@nestjs-common-npm-9.3.9-aa8dde60a2-48fde36bef.zip/node_modules/@nestjs/common/serializer/)
Ancestor breaking the chain: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: @nestjs/testing@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: experiment@workspace:.
ERROR in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/nest-application.js 19:107-150
Module not found: Error: @nestjs/core tried to access @nestjs/websockets (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.Required package: @nestjs/websocketsRequired by: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/)Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: @nestjs/testing@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: experiment@workspace:.ERROR in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/nest-application.js 20:124-177Module not found: Error: @nestjs/core tried to access @nestjs/microservices (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: @nestjs/microservices
Required by: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/)
Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: experiment@workspace:.
ERROR in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/nest-application.js 122:120-152
Module not found: Error: @nestjs/core tried to access @nestjs/microservices (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.Required package: @nestjs/microservicesRequired by: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/)Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9Ancestor breaking the chain: experiment@workspace:.ERROR in ../../.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/nest-factory.js 57:120-152Module not found: Error: @nestjs/core tried to access @nestjs/microservices (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: @nestjs/microservices
Required by: @nestjs/core@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9 (via /Users/fabio/projects/test/nx-nestjs-yarn-example/.yarn/unplugged/@nestjs-core-virtual-e8ebea8e3e/node_modules/@nestjs/core/)
Ancestor breaking the chain: @nestjs/platform-express@virtual:97b59d416a009439fa8dbc23c5107e61f2df4eeb4d52731c32ca239deaeb6407a49d416ea32b9198a31d27f9142fe2b91a03d92e3f0ad8d911021b64e723395a#npm:9.3.9
Ancestor breaking the chain: experiment@workspace:.
webpack compiled with 8 errors and 13 warnings (2bb0c791ddacc81d)
There was an error with the build. See above.
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
If you try to run a NestJS app with nx in combination with yarn v3 in pnp mode, you get a bunch of errors during build about incorrect dependency resolution. This does not happen when running a NestJS app with yarn v3 without nx.
Expected Behavior
I expect the NestJS app to build successfully with this combination of tools. Yarn v3 with pnp as the nodeLinker is giving us great benefits during local & CI builds.
GitHub Repo
https://github.com/fabiog27/nx-nestjs-yarn-example
Steps to Reproduce
yarn install
yarn nx serve experiment
Nx Report
Failure Logs
Additional Information
No response
The text was updated successfully, but these errors were encountered: