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

paths in Error.stack "multiply" ...? #55

Open
mindplay-dk opened this issue Apr 1, 2022 · 0 comments
Open

paths in Error.stack "multiply" ...? #55

mindplay-dk opened this issue Apr 1, 2022 · 0 comments

Comments

@mindplay-dk
Copy link

I tried switching from ts-node to esbuild-runner, as you can see here.

In this project, and I obtain paths from Error.stack, very simply, as you can see here:

        const location = new Error().stack!
          .split("\n")[2]
          .replace(/^\s+at /, "");

For some reason, the paths in stack-traces appear to... multiply?

For example, if you run npm run test, you'll see test output like this:

  × [equal] it produces the expected test results
  └ /home/mindplay/workspace/funky-test/test/test/test.ts:76:10

That path is /home/mindplay/workspace/funky-test/test/test.ts:76:10, so there's a /test too many in there.

As there is test coverage for that fact, you will see failing tests as well:

   ×          "location": "/home/mindplay/workspace/funky-test/test/test/cases.ts:9:6",
   √          "location": "/home/mindplay/workspace/funky-test/test/cases.ts:9:6",

Something appears to be not right with the run-time path resolution of this loader?

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

1 participant