Ts-jest: Sourcemaps are broken for JavaScript files imported by TypeScript files

Created on 6 Apr 2018  路  8Comments  路  Source: kulshekhar/ts-jest

  • 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:

https://github.com/facebook/jest/issues/5925

Most helpful comment

Jest 23 is out with the fix

All 8 comments

I had the same issue, but fixed it using "disableSourceMapSupport": true as described in:
https://github.com/kulshekhar/ts-jest/issues/340#issuecomment-374051766

This works for the this trivial case but didn't work for my more complex case. However with this change: https://github.com/facebook/jest/pull/5945

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

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

Jest 23 is out with the fix

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

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

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

@huafu I just updated to [email protected] and [email protected] 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

remcohaszing picture remcohaszing  路  4Comments

ahnpnl picture ahnpnl  路  3Comments

GeeWee picture GeeWee  路  4Comments

TKJohn picture TKJohn  路  4Comments

stangerjm picture stangerjm  路  4Comments