-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Source maps not working in Node 21.6 and above #478
Comments
You're probably encountering this: https://github.com/privatenumber/tsx/discussions/464 Do you mind filing a bug report in Node.js? |
@privatenumber I'm using IntelliJ to debug but I can reproduce the same problem there. Reverting to node 21.5.0 as you recommended fixes the problem. One thing that might help is that I noticed |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
As per the contribution guide, please refrain from "also happening in ..." comments. Try to add value by debugging the problem to find potential solutions. Locking issue to direct further conversation to PRs. |
Acknowledgements
Minimal reproduction URL
See below
Version
v4.7.1
Node.js version
v21.6.1
Package manager
npm
Operating system
Windows
Problem & Expected behavior
I'm having the same issue as #260, but I cannot reply there as the issue is locked. Breakpoints don't work because VS Code is putting a breakpoint on the compiled and minified JS code, instead of the original TS source. To reproduce:
Use the
launch.json
file given in your documentation (either method).Create a simple TS file
test.ts
, for example:Put a breakpoint on the second line.
Press F5.
Instead of breaking on the original
test.ts
, VS Code will open a new tab with the titletest.ts
, except that it will be the compiled and minified JS code, as in the following screenshot:Note also that it will print out
1
to the terminal, because it's breaking on the second (empty) line of the compiled JS code, NOT on the second line of the original TS code.Furthermore, if I add a third line and put a breakpoint on that, then it doesn't break at all, since the compiled code only has 2 lines ( the second one being empty).
As suggested in #260, I tried setting
inlineSourceMap
and/orinlineSources
totrue
intsconfig.json
, but that does not resolve the problem. That issue originally seems to have been resolved by upgrading Node from v12 to v14, but I'm using Node v21, so that does not apply to me.Is this a bug? Or am I doing something wrong? If it's a bug, then it should be fixed, since
tsx
is not so useful in development if debugging doesn't work. If I'm doing something wrong, please tell me what I should do instead (and ideally also add that to the documentation, since I followed your documentation very closely and it doesn't work).Thanks!
Contributions
The text was updated successfully, but these errors were encountered: