Skip to content
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

v23 breaks WebStorm breakpoints #627

Closed
j-maas opened this issue Jul 19, 2018 · 14 comments · Fixed by #660
Closed

v23 breaks WebStorm breakpoints #627

j-maas opened this issue Jul 19, 2018 · 14 comments · Fixed by #660
Assignees
Labels

Comments

@j-maas
Copy link

j-maas commented Jul 19, 2018

Issue

v23 breaks WebStorm's ability to set and hit breakpoints.

Expected behavior

Tests should remain debuggable after upgrading to v23.

Output from your debug log

Not created. I set the environment variable TS_JEST_DEBUG="true", but neither the WebStorm run nor the console run (TS_JEST_DEBUG="true" yarn test) create a file at ./node_modules/ts-jest/debug.txt**.

Link to a minimal repo that reproduces this issue

https://github.com/Y0hy0h/ts-jest-debug

Instructions are in the repo's README.

Additional Info

Obviously, this is a breaking change in v23 and it could be considered noting it in issue #601.

@xmclark
Copy link

xmclark commented Jul 19, 2018

I was struggling with this problem yesterday. Thank you for reporting this issue!

@huafu
Copy link
Collaborator

huafu commented Jul 24, 2018

tested, #626 will fix this (tho you NEED to remove the --watchAll option from the run configuration for it to work, even in 22.x – but yeah, it's broken in actual 23.0.1)

@huafu
Copy link
Collaborator

huafu commented Aug 3, 2018

fixed in 23.1.2

@huafu huafu closed this as completed Aug 3, 2018
@nodece
Copy link

nodece commented Aug 4, 2018

I think can not close this issue, use ts-jest@23.1.2 and jest@23.4.2 breakpoint still not hit, use ts-jest@22.4.6 is work

@huafu
Copy link
Collaborator

huafu commented Aug 4, 2018

Hi @nodece, thanks for the feedback.
Can you provide the link to a minimal repo where we can reproduce the issue, it'll help us fix it.

@huafu
Copy link
Collaborator

huafu commented Aug 4, 2018

hmmm. I've tested that one with the repo provided by @y0hy0h, just testing again now and it doesn't work... weird. @nodece no need for a minimal repo!

Ok, good I waited to post this comment. If you add @babel/core, then it'll work with breakpoints. If you cannot, or don't wan't to add it and still use the v6, then you can add debugger as a workaround. I guess it has something to do with how babel is handling source-map depending on the versions. So I wouldn't say that it directly depends on ts-jest version, but on the babel version used under the hood. I'll take a look as soon as I have a bit of time today.

@huafu huafu reopened this Aug 4, 2018
@huafu huafu self-assigned this Aug 4, 2018
@huafu huafu added the 🐛 Bug label Aug 4, 2018
@nodece
Copy link

nodece commented Aug 4, 2018

@y0hy0h Thanks.

@huafu
Copy link
Collaborator

huafu commented Aug 5, 2018

btw @y0hy0h you used roots in jest. This is used to define multiple PROJECTs, so you should use "rootDir": "../src", and define mapping accordingly instead

UPD: sorry I am wrong, I mistaken with the projects option

@j-maas
Copy link
Author

j-maas commented Aug 5, 2018

@huafu But generally, if you'd like to have anything changed in the repo, just submit a PR. ;)

@huafu
Copy link
Collaborator

huafu commented Aug 5, 2018

Oh man now re-installing everything and clearing all caches I know of it DOES work!....

@huafu
Copy link
Collaborator

huafu commented Aug 5, 2018

oooohhh OK found it

this is a babel issue, the fix is: babel/babel@21fdaa2

...now looking at what can be done ts-jest's side

@nodece
Copy link

nodece commented Aug 5, 2018

Use typescript,not use babel, why is the v22.4.6 version available? @huafu

@huafu
Copy link
Collaborator

huafu commented Aug 5, 2018

ts-jest uses babel under the hood for hoisting and also instrumentation. You can look in the git history of babel to find out why it was working in v22, sorry I have no time for this now. I guess jest was adding the sourcemap comment itself in 22...

Now working on a fix (which will be a hack) so that we can continue to use babel 6 with breakpoints...

huafu added a commit to huafu/ts-jest that referenced this issue Aug 5, 2018
It fixes kulshekhar#627, but AFAIK there is badly no way of doing a test for that
@huafu
Copy link
Collaborator

huafu commented Aug 5, 2018

🎉

screen shot 2018-08-05 at 17 22 29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants