-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Broken sourcemap in the stack trace of uncaught errors #447
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
@unleashy Not just a Windows problem. Same bug for me on MacOS (14.3.1). |
Thanks for reporting—happy to accept a PR to fix this! Locking thread to direct further dialogue in the form of PRs. |
I believe you were experiencing #478 which was fixed in v4.7.2 Your problem is happening in Node v20.10.0, which means it's not related to #478 I don't have a Windows but it works fine for me on Mac. |
Closing as a reproduction was not provided |
@privatenumber
Output - notice that the file is correct, but location is
|
Thanks, I can reproduce the error with that, but I don't think this is related to what @unleashy reported. @unleashy's reproduction allegedly errored with a single file. In your case, the issue comes from I'm still interested in the original issue @unleashy is reporting, but I'm going to lock this thread to prevent piling on since it's happened twice already. |
Acknowledgements
Minimal reproduction URL
https://gist.github.com/unleashy/6b0956eb7572cafbf0eb5f18c9c491a4
Version
v4.7.0
Node.js version
v20.10.0
Package manager
N/A
Operating system
Windows
Problem & Expected behavior
Run
npx tsx foo.ts
with the code from the gist:Basically if an uncaught error is displayed, as per normal node procedure the line of the code where the error was thrown is shown, in the original sourcemap. However tsx dumps the whole contents of the file, minified, into the console. For small files, as in the reproduction, I guess this is fine? But for big files the console gets utterly spammed with completely useless minified code. Curiously, the file paths are correct.
I couldn't get to reproduce this on Stackblitz… so I'm guessing this is some sort of Windows problem? But it doesn't happen with ts-node.
I tested with npm and yarn and both had the same result. And whatever is in tsconfig.json seems to make no difference.
The expected behaviour for me would be for the code displayed in the error trace to only show the line of the affected code, source-mapped to the original Typescript.
Contributions
The text was updated successfully, but these errors were encountered: