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
Setting yarn to use version 2>= with Plug n Play as nodeLinker and running nx test fails, possibly due to lack of ESM support from yarn berry's pnp mode.
Check Failure Log for further detail.
Expected Behavior
nx test should not fail with an external error.
Steps to Reproduce
npx create-nx-workspace
Workspace name: test-nrwl-jest
What to create in the new workspace: apps
cd test-nrwl-jest
yarn set version berry
Change nodeLinker config to pnp in .yarnrc.yml
yarn add -D @nrwl/node
yarn add -D @nrwl/jest
yarn nx g @nrwl/node:application test-app
add a test file e.g main.spec.ts to newly created test-app
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'resolvedFileName')
at module.exports (../../.yarn/cache/@nrwl-jest-npm-14.5.10-835c314aa3-79dab015fe.zip/packages/jest/plugins/resolver.ts:85:22)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.248 s
Ran all test suites.
Environment
> NX Report complete - copy this into the issue template
Node : 16.16.0
OS : darwin x64
yarn : 3.2.3
nx : 14.5.10
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : Not Found
@nrwl/eslint-plugin-nx : 14.5.10
@nrwl/express : Not Found
@nrwl/jest : 14.5.10
@nrwl/js : Not Found
@nrwl/linter : 14.5.10
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : 14.5.10
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 14.5.10
typescript : 4.7.4
---------------------------------------
Local workspace plugins:
---------------------------------------
Community plugins:
I think this issue is related to #10296, #10414 and #11335.
Maybe making it a dynamic import as per #10414 can fix it.
I might try a similar fix to the above if I have time.
The text was updated successfully, but these errors were encountered:
We are working on addressing support for Yarn, but pnp in particular is likely to still have issues in several places. Yarn berry / pnp support is tracked in #2386, so I'm going to close this out.
Current Behavior
Setting yarn to use version 2>= with Plug n Play as nodeLinker and running
nx test
fails, possibly due to lack of ESM support from yarn berry's pnp mode.Check Failure Log for further detail.
Expected Behavior
nx test
should not fail with an external error.Steps to Reproduce
npx create-nx-workspace
test-nrwl-jest
apps
cd test-nrwl-jest
yarn set version berry
nodeLinker
config topnp
in.yarnrc.yml
yarn add -D @nrwl/node
yarn add -D @nrwl/jest
yarn nx g @nrwl/node:application test-app
main.spec.ts
to newly created test-appyarn nx test
Failure Logs
Environment
I think this issue is related to #10296, #10414 and #11335.
Maybe making it a dynamic import as per #10414 can fix it.
I might try a similar fix to the above if I have time.
The text was updated successfully, but these errors were encountered: