I'd like to use the node --debug-brk
feature described in a previous answer and the jest docs to debug in npm/yarn 1 based projects, but node_modules/
is not present in Yarn 2 / PnP (Plug n Play) based projects, so those instructions won't work for me.
The usual way to access a binary in yarn 2 of yarn run --inspect-brk jest --runInBand
launches a debugging session from the terminal, but when connecting to Chrome's Remote Target inspector via chrome://inspect
, we get an error message about being unable to connect to the jest.js binary, since it's a path to a .zip
file.
Uncaught Error: Cannot find module '/Users/MY_USERNAME/PATH_TO_MY_PROJECT/.yarn/cache/jest-npm-24.9.0-8ddb425e99-2.zip/node_modules/jest/bin/jest.js
What workarounds are available without downgrading to Yarn 1?