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

Sourcemaps are broken for JavaScript files imported by TypeScript files #485

Closed
jamietre opened this issue Apr 6, 2018 · 8 comments
Closed

Comments

@jamietre
Copy link

jamietre commented Apr 6, 2018

  • Issue

When running TypeScript tests, if an error occurs in a JavaScript dependency, the source map is not preserved; stack trace has line number in compiled code.

  • Expected behavior

Source maps always work.

  • Output from your debug log

none

  • Link to a minimal repo that reproduces this issue

https://github.com/jamietre/jest-source-map-problem/tree/20b8c62b45d19ca241b181f994d3bd6d3527fe69

Possibly related issue:

jestjs/jest#5925

@jamietre jamietre changed the title Sourcemaps are incorrect for JavaScript files imported by TypeScript files Sourcemaps are broken for JavaScript files imported by TypeScript files Apr 6, 2018
@felipeochoa
Copy link

I had the same issue, but fixed it using "disableSourceMapSupport": true as described in:
#340 (comment)

@jamietre
Copy link
Author

jamietre commented Apr 11, 2018

This works for the this trivial case but didn't work for my more complex case. However with this change: jestjs/jest#5945

and disableSourceMapSupport all my problems seem to go away...

@kulshekhar
Copy link
Owner

@jamietre thanks for pointing that out. I'll wait for that change to be published and then check back on this issue

@SimenB
Copy link
Contributor

SimenB commented May 26, 2018

Jest 23 is out with the fix

@GeeWee
Copy link
Collaborator

GeeWee commented May 27, 2018

Can you confirm this issue is fixed in Jest 23? @SimenB ?

@SimenB
Copy link
Contributor

SimenB commented May 27, 2018

no, just that the fix @jamietre said worked for them is released

@huafu
Copy link
Collaborator

huafu commented Sep 2, 2018

This should have been fixed in latest version. If it's not the case, please re-open the issue ;-)

@huafu huafu closed this as completed Sep 2, 2018
@jamietre
Copy link
Author

@huafu I just updated to jest@23.6.0 and ts-jest@23.1.4 and everything seems to be working.

I had to change ts-jest config to "disableSourceMapSupport": false whereas before I had to have it set to true to work around the problem. So all seems good at this point.

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

No branches or pull requests

6 participants