-
Notifications
You must be signed in to change notification settings - Fork 207
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
Log uncaught source-mapped errors to the console #446
Conversation
|
const sourceFile = maybeGetFile(workerSrcOpts, file); | ||
if (sourceFile?.path === undefined) return null; | ||
|
||
// Find the last source mapping URL if any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the last?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourceMappingURL
may appear in earlier comments/string-literals and we want to ignore those. This is what source-map-support
and get-source
(dependency of stacktracey
) do.
Previously, errors _thrown_ using the `MF-Experimental-Error-Stack` header were only shown in a pretty-error page. This PR logs those errors with source-maps applied to the console too, using the `source-map-support` package. This simplifies our code, and also means we don't need to touch internal Youch methods, as the errors we pass to Youch are already source-mapped.
53f8850
to
2341ed8
Compare
Previously, errors thrown using the
MF-Experimental-Error-Stack
header were only shown in a pretty-error page. This PR logs those errors with source-maps applied to the console too, using thesource-map-support
package. This simplifies our code, and also means we don't need to touch internal Youch methods, as the errors we pass to Youch are already source-mapped.