-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Line number printed in the tracing stack is not correct #2390
Comments
Ref #1559 |
There seems to be variability in errors on if they are 0 or 1 indexed when they come from V8 and when the source mapped is applied. Thanks for the reproduction, we should be able to try to fix that then. |
In master branch, deno seems handling the above example correctly. (maybe fixed in #2487) $ ./target/debug/deno test.ts
[1/1] Compiling file:///Users/kt3k/s/deno/test.ts
error: Uncaught Error: An error occurred here
► file:///Users/kt3k/s/deno/test.ts:4:7
4 throw new Error('An error occurred here');
^
at file:///Users/kt3k/s/deno/test.ts:4:7 |
Ah, I had forgot about this, but I do think #2487 did fix this. What was happening was that we weren't previously remapping the "outer" part of the error, only the stack trace, so the source line, start column and end column were the emitted file, not the original file. Now they are all the original file. 🎉 |
Here's my file
test.ts
I ran
deno run test.ts
I got this:The number of the line where the error occurs is expected to be
4
but I got3
in the above line. (The number reported by tsc itselft is correct, obviously)Platform: macOS/Linux
Deno version: 0.6.0
I also came across this issue when I tried checking out which line caused the failure of my pr in Azure pipeline. I checked the log and got the wrong line number, too...
The text was updated successfully, but these errors were encountered: