Skip to content

Should I expect the V8 Error.prepareStackTrace API to work? #1517

Answered by cspotcode
mattwynne asked this question in Q&A
Discussion options

You must be logged in to vote

We install @cspotcode/source-map-support at startup, which implements its own Error.prepareStackTrace to rewrite the stack trace strings, apply sourcemaps. I'm guessing that, when you replace our hook with your own, you're losing the benefit of these mappings.

I believe that the wrapCallSite export of @cspotcode/source-map-support is what you want to use. If I recall correctly, it is used to modify each callsite object, applying sourcemaps. So you can use it to get accurate, source-mapped callsites.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mattwynne
Comment options

@mattwynne
Comment options

Answer selected by mattwynne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants