-
Notifications
You must be signed in to change notification settings - Fork 210
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
Request: Always resolve source maps on Errors #729
Comments
I might be mistaken but I think that, in latest Miniflare 3, the error comes already stringified from Workerd and Miniflare just prints it without modifying the stack trace. Somewhere around here. Maybe that's the place to add sourcemaps 🤔 |
Hey! 👋 Yep, in Miniflare 3 (which I'm assuming this issue is for), we just see a string from
This is the same problem as logging stacks to the console (i.e. console.log(new Error().stack) );There was a PR to workers-sdk to address this issue (cloudflare/workers-sdk#3739). We're planning on addressing that soon. 👍
|
Can’t believe I didn’t see that—thank you! I’ll leave it to you to whether you wanna close this issue now or after that ships :) |
Hey! 👋 Thanks for raising this issue. I was going to transfer this to |
For this worker:
I would expect the
console.error
call to print the error with a source mapped stack trace (like it does if Ithrow
the error), but it doesn’t. I hunted through the Miniflare code and found that we do construct source maps for thrown errors, but don’t overrideprepareStackTrace
by default.I tried removing the line
Error.prepareStackTrace = originalPrepareStackTrace;
ingetSourceMapper()
and callinggetSourceMapper()
on launch, but it didn’t seem to overrideprepareStackTrace
. Nor did passingNODE_OPTIONS=--source-map-support
towrangler dev
.I’m not expecting this to be fixed anytime soon (although I’ll happily take pointers on how to fix it myself!), but I wanted to raise the issue so it’s tracked somewhere. Cheers again for all the hard work on this repo, it’s not unappreciated ❤️
The text was updated successfully, but these errors were encountered: