-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
Cannot debug Jest in VSCode without npm install --legacy-bundling? #19566
Comments
@jbsulli I've run into this very same issue and I resolved it by setting source maps. Hope this helps. In my .babelrc:
And in my launch.json:
And the dev dependencies I have:
|
@clintjhill, awesome! I'm excited to check this out when I get back. Thank you! |
Anyone have a solution when using typescript? |
What If I'm not using babel ? I'm using jest to node backends |
@auchenberg I think a "Debugging Jest" recipe would be helpful |
This was a fun one to track down. I was not able to get Jest to debug properly to work on my primary laptop and, after several hours of mucking with it, I tried my second laptop. It worked! After comparing differences, I noticed npm was way out of date and ultimately I discovered the hack below. I feel this is an issue the Jest team must address (and I'll be submitting a issue with them) but I was hoping your team might have some insight? At the very least, others having this issue might find this useful.
Steps to Reproduce:
npm install
, put a breakpoint on__tests__/sum-test.js:2
, and run.What I see is, even though I have the
sum-test.js
page open, a new tab labeledc:\github\debug-jest-in-vscode\__tests__\sum-test.js
is opened (note: I cloned toC:\github\debug-jest-in-vscode
). If you hover over the tab, the full path it shows is\1000\c:\github\debug-jest-in-vscode\__tests__\sum-test.js
. Also, my code is wrapped with({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){
+}});
. The breakpoint is still respected and the program stops in the correct spot; however, neither placing new breakpoints nor editing code in the mystery tab seems to work.Now, to get it to work:
node_modules
folder entirely.npm install --legacy-bundling
, put a breakpoint on__tests__/sum-test.js:2
, and run.Now everything is peachy and runs and behaves as expected. Any thoughts?
The text was updated successfully, but these errors were encountered: