Skip to content

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

Description

@s5no5t

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions