-
Notifications
You must be signed in to change notification settings - Fork 51
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
Debug source map problem #9
Comments
Seeing the same issue https://github.com/aelbore/esbuild-jest/blob/master/src/index.ts#L30 I think return {
code: result.js,
map: {
...JSON.parse(result.jsSourceMap),
sourcesContent: null
}
}; should be return {
code: result.code,
map: {
...JSON.parse(result.map),
sourcesContent: null
}
}; this needs to be updated if you're running https://github.com/evanw/esbuild/blob/14c2fac4874c8b2bbae88bf3bfb6351b447fd9c3/CHANGELOG.md#080
🩹If you don't want to wait for the package to be updated, roll back esbuild, (and like me, don't have the time to do the PR for a fix), you can copy the script to a local folder (like |
Issue persists with esbuild@0.80 or newer as per @dasDaniel aelbore#9
@syvlabs thanks much for the PR, I didn't notice you have I already updated the code, again many thanks. |
I'm having something similar in WebStorm's built-in debugger--it doesn't stop on any breakpoints. Has anyone tried this in WebStorm? |
I'm facing the same problem using Wallaby.js. Here's a little video demo of the problem I'm facing: https://www.loom.com/share/4f7fc35bb0144c53b8ab47d1f15f7e72 I suspect this to be a problem in |
thanks @schickling, i will look into this also. |
I believe this is happening because I figured this out by looking at what |
This allows VSCode or other development tools to debug the produced source code just by reading the transformed contents, as well as Jest to produce its nice error assertion messages. Fixes aelbore#9
…nd returned sourcemaps for Jest esbuild v0.8.31 supports returning a sourcemap as well as adding it inline. We want an inline sourcemap to facilitate debugging transformed source from within an editor (like VSCode) as well as a returned sourcemap to pass into Jest for it's nice assertion messages. Fixes aelbore#9.
Thanks for your help @airhorns! 🙏 |
esbuild v0.8.31 supports returning a sourcemap as well as adding it inline. We want an inline sourcemap to facilitate debugging transformed source from within an editor (like VSCode) as well as a returned sourcemap to pass into Jest for it's nice assertion messages. Fixes aelbore#9.
What's the current situation with this issue? Should setting |
…ild (#17) * Use sourcemaps: both from esbuild for inline sourcemaps for editors and returned sourcemaps for Jest esbuild v0.8.31 supports returning a sourcemap as well as adding it inline. We want an inline sourcemap to facilitate debugging transformed source from within an editor (like VSCode) as well as a returned sourcemap to pass into Jest for it's nice assertion messages. Fixes #9. * fix: ensure breakpoints pause within the actual source ..instead of a readonly version based on `sourcesContent`. # Conflicts: # src/index.ts * Turn sourcemaps on by default since esbuild is so fast at producing them Co-authored-by: Alec Larson <1925840+aleclarson@users.noreply.github.com>
I'm trying to switch from
ts-jest
toesbuild-jest
. Totally works as a swap in (thanks!) except when I try to debug a test. When the debugger starts, the breakpoint I set jumps from being in my.ts
file to the compiled javascript file. I'm usingvscode
.Any ideas on settings I might need to change to get this work correctly?
The text was updated successfully, but these errors were encountered: