-
Notifications
You must be signed in to change notification settings - Fork 773
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
🐛 BUG: Wrangler 3 and Wrangler 2 both point to incorrect source code in stack traces #3383
Comments
Thanks for reporting this! Could you link a reproduction repo so we can investigate more? What sort of stack traces are you expecting to see? |
@penalosa I just created this minimal reproduction repository https://github.com/BillBrower-Shopify/wrangler-source-map-reproduction The stack trace from a sample indie-stack Remix app running on Node with an error thrown in the index route looks like this:
An equivalent app run inside of Wrangler with an error thrown in the index route produces a stack trace that looks like this:
|
Hey! 👋 The problem here is that Remix is catching the error inside the worker. If you create a TypeScript worker like... export default <ExportedHandler>{
async fetch() {
try {
throw new Error("Ooops!");
} catch (e) {
return new Response(e.stack);
}
}
} ...you'll see the stack trace refers to the built JavaScript file instead. Unfortunately, export default <ExportedHandler>{
async fetch() {
throw new Error("Ooops!");
}
} ...that should source map correctly. I believe we're planning to add support to |
Thanks @mrbbot! That makes sense, I'll follow up with the Remix project and see if there's a way to configure that for development purposes and then have the worker render an error page from Wrangler instead |
@mrbbot The Remix team said there is no way to configure Remix to bubble the errors up to Wrangler instead of catching them |
Hey! 👋 Just to keep you updated, we're planning to fix this issue as part of #3739 (comment) and cloudflare/miniflare#729 soon. 👍 |
Which Cloudflare product(s) does this pertain to?
Wrangler
What version of
Wrangler
are you using?3.0.0
What operating system are you using?
Mac
Describe the Bug
Both Wrangler 2.15.0 with
--experimental-local
and 3.0.0 without any--local
or--experimental-local
flag point to incorrect files and line numbers when displaying stack traces. That is stack traces end up looking like this:The text was updated successfully, but these errors were encountered: