evanw / evanw/node-source-map-support
XMLHttpError on Chrome Extension page, original error discarded
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Description
Having a problem using `source-map-support` in a Chrome extension. Narrowed it down to a failed attempt to retrieve an extension-specific page (`extensions::uncaught_exception_handler`) via XMLHttpRequest. The impact is that any errors that occur within these chrome API callbacks get eaten.
Screenshot:

The `XMLHttpRequest` error seems to print regardless of whether the `send` is in a `try..catch`, and only clutters the console. The `NetworkError` is the one that is blocking.
Minimal example [here](https://github.com/chrahunt/node-source-map-support-repro).
A good solution to this would not show the XMLHttpRequest error and for irretrievable intermediate sources in the stack just show the original "file"/line number. A try...catch could take care of the latter. To avoid displaying the cosmetic error it could help to check for known valid protocols, but that won't work in all cases since it depends on permissions I don't think are queryable without trying the request.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.