evanw / evanw/node-source-map-support

XMLHttpError on Chrome Extension page, original error discarded

Aperta
#143 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.2k
Fork
223
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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:

![image](https://cloud.githubusercontent.com/assets/2312275/16902514/c4397e30-4c2e-11e6-8edb-9a4096de7fe0.png)

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con la riproduzione minima collegata e traccia la gestione di XMLHttpRequest di source-map-support per la pagina specifica dell’estensione `extensions::uncaught_exception_handler`. Verifica che i fallimenti conservino le informazioni originali sul file e sulla riga negli stack trace, evitando al contempo l’errore cosmetico di XMLHttpRequest nella console.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.