inspector: response.setEncoding() causes response.on('data') never triggered when --experimental-network-inspection is enabled
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.3k
- Merge medio
- 4g 2h
- PR unite (30g)
- 283
Descrizione
Version
v24.17.0
Platform
Windows 11 x64 (10.0.26200)
Subsystem
No response
What steps will reproduce the bug?
When experimental network inspection is enabled, calling response.setEncoding() on an http.IncomingMessage causes Node Inspector to throw exception.
The exception interrupts normal stream processing. response.on("data") callback never triggered.
const http = require('http');
http.get("http://example.com", (response) => {
response.setEncoding("utf8");
response.on("data", chunk => {
console.log(chunk);
});
response.on("end", () => {
console.log("end");
process.exit(0);
});
});
Run node --inspect --experimental-network-inspection main.js then open any inspector frontend (Chrome DevTools).
How often does it reproduce? Is there a required condition?
When network inspection feature enabled.
What is the expected behavior? Why is that the expected behavior?
Network inspection should continue to work regardless of whether response.setEncoding() is used.
What do you see instead?
Nodejs throws exception and interrupts normal stream processing. response.on("data") callback never triggered.
Additional information
VSCode extension debugging host enables this feature and breaks my extension development. Waste 2 days to find out why every http request got empty response.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia eseguendo l’esempio HTTP fornito con node --inspect --experimental-network-inspection main.js e un frontend dell’inspector, quindi cattura l’eccezione attivata da response.setEncoding(). Traccia la gestione dell’ispezione di rete che interrompe il flusso; il lavoro è completato quando i callback data e end vengono eseguiti normalmente con la codifica abilitata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend, devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100