-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Some async code doesn't produce stack trace on error #2704
Comments
It seems this is a JavaScriptCode bug, if the function is async, JSC cannot produce the full stack trace. For example: async function foo() {
await Promise.resolve(null);
throw new Error("something went wrong");
}
async function bar() {
await foo();
}
(async () => {
try {
await bar();
} catch (err) {
console.log(err);
}
})(); In Bun, it logs like this:
And in Safari (Console Snippets), it logs like this:
The stack trace of the async functions are all lost. |
This is a significant annoyance for my application that runs using Bun. I assume this is a pretty deep issue seeing as it comes from JSC, but if someone could point towards a potential fix I'd like to help work on/support this feature. If it seems intractable due to structural reasons in JSC, that's also helpful to know and I can just workaround by adding more try/catches in userspace. |
+1 pretty annoying |
+1 |
What version of Bun is running?
0.5.9
What platform is your computer?
Linux
What steps can reproduce the bug?
What is the expected behavior?
Expect stack trace for the first case.
What do you see instead?
Stack trace is missing.
Additional information
Thanks!! :) (Thought that maybe this should be a feature - but the bug reporting template was more useful, so I picked that.)
The text was updated successfully, but these errors were encountered: