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

Incorrect file path parsing with anonymous async function #15

Open
byanofsky opened this issue Feb 7, 2024 · 0 comments
Open

Incorrect file path parsing with anonymous async function #15

byanofsky opened this issue Feb 7, 2024 · 0 comments

Comments

@byanofsky
Copy link

Seems when error stack trace includes an async, anonymous callee, the parsed stack trace file information is incorrect.

Repro:

Assume following error stack trace:

stack Error: test
    at f (https://some-domain.com/sample-program.js:18:15)
    at async https://some-domain.com/sample-program.js:22:11

Results in a second item with following properties:

file: "async https://some-domain.com/sample-program.js"
fileRelative: "some-domain.com/sample-program.js"
fileShort: "some-domain.com/sample-program.js"

Expected properties:

file: "https://some-domain.com/sample-program.js"
fileRelative: "sample-program.js"
fileShort: "sample-program.js"

Misc

Can reproduce the above error stack trace by running the following node program:

(async () => {
    await Promise.resolve();
    throw new Error('test');
})();
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