Skip to content
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 numbers in stack trace wrong (on Windows) #1058

Closed
s5no5t opened this issue May 28, 2020 · 8 comments
Closed

Line numbers in stack trace wrong (on Windows) #1058

s5no5t opened this issue May 28, 2020 · 8 comments

Comments

@s5no5t
Copy link

s5no5t commented May 28, 2020

Expected Behavior

I use ts-node to run an express app. An error handler catches exceptions. I expect line numbers to match the actual ones.

Actual Behavior

The line numbers don't match.

Steps to reproduce the problem

  1. Run our (non-open-source) express app using ts-node
  2. Trigger some exception
  3. See stack trace with wrong line numbers

Minimal reproduction

When I run TypeStrong/ts-node-repros#4 locally on my Windows machine, I get different results compared to the Github Action result.

Github Action (correct):
grafik

Local machine (wrong):
grafik

On my machine, it reports line 4 to throw, as opposed to line 6 in the Github Action.

When I set hookRequire = true in the sourceMap setup, it starts reporting correct line numbers on my machine, too.

grafik

grafik

Specifications

ts-node v8.10.1
node v12.17.0
compiler v3.9.3

  • Operating system and version: Windows 10

  • If Windows, are you using WSL or WSL2?: No

@s5no5t s5no5t changed the title Line numbers in stack trace wrong Line numbers in stack trace wrong (on Windows) May 28, 2020
@cspotcode
Copy link
Collaborator

Might this be a duplicate of #1055 & #1037?

@s5no5t
Copy link
Author

s5no5t commented May 28, 2020

@cspotcode absolutely! will close this.

Duplicate of #1055

@s5no5t s5no5t closed this as completed May 28, 2020
@s5no5t
Copy link
Author

s5no5t commented May 28, 2020

I can confirm that this works when using master.

@cspotcode
Copy link
Collaborator

@jugglingthebits Thanks, I'm working on preparing a release to fix this. Unfortunately, I am swamped at work this week, so I think I'm going to publish as a different npm dist-tag so that people can install and test. Then when I get confirmation that it works, I'll promote the dist-tag to latest so it's installed from npm by default.

@s5no5t
Copy link
Author

s5no5t commented May 28, 2020

@cspotcode thanks you! I can test the update here if it helps.

@cspotcode
Copy link
Collaborator

@jugglingthebits I just published 8.10.2 to npm as the next dist-tag. If you're able to do a quick test, I'll be very grateful.
image

@s5no5t
Copy link
Author

s5no5t commented May 28, 2020

I can confirm that it works for me (on Windows)

@s5no5t
Copy link
Author

s5no5t commented May 29, 2020

@cspotcode thank you for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants