-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Error.prepareStackTrace isn't called #49681
Comments
Go to https://v8.dev/docs/stack-trace-api and read the section on Error.prepareStackTrace. Yours is buggy because you don't return anything. |
@bnoordhuis No, that isn't it. In general, returning Here is another example script:
Running this with Node.js v20.0.0 and the custom
However, calling it with v20.1.0 and it is not:
I don't see anything in https://nodejs.org/en/blog/release/v20.1.0 that sticks out that would have changed this behaviour, but I gather this would have been a change in the guts of v8, so perhaps:
I haven't looked at the v8 diff -- I don't know v8 well at all. If the
|
Ah, that v8 diff includes: v8/v8@4d08e2d So, obviously, that'll be it. |
Version
20.1.0
Platform
Linux 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
When defining a stacktrace using Error.prepareStackTrace = function(_,stack) {...}
As of node version 20.1.0 the function isn't called anymore.
How often does it reproduce? Is there a required condition?
Any Node version after 20.0.0
What is the expected behavior? Why is that the expected behavior?
Function defined in Error.prepareStackTrace would be called.
What do you see instead?
The function isn't called.
Additional information
No response
The text was updated successfully, but these errors were encountered: