Loader stalls MessagePort since v24
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.15.0
Platform
Linux lab178 6.18.19-1.qubes.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 01:20:46 GMT 2026 x86_64 GNU/Linux
Subsystem
module
What steps will reproduce the bug?
In an async resolve hook of a custom loader, await a message from a MessagePort. The message never arrives and the promise never resolves.
This repository has a reproduction. It does a simple pong exchange with the main thread. On v23 and before it works. On v24 and later it hangs forever.
https://github.com/cinderflash/loader-stall
$ nvm use v23
Now using node v23.11.1 (npm v10.9.2)
$ node index.mjs
ping
PONG
ping
PONG
ping
PONG
$ nvm use v24
Now using node v24.15.0 (npm v11.12.1)
$ node index.mjs
(STALL FOREVER)
$ nvm use v25
Now using node v25.9.0 (npm v11.12.1)
$ node index.mjs
(STALL FOREVER)
How often does it reproduce? Is there a required condition?
On v24 and v25, 100% of the time.
On prior versions, this never happens.
What is the expected behavior? Why is that the expected behavior?
Ability to perform exchanges with the main thread within a loader hook.
I'd like to use this to acquire information available on the main thread to use in determining how to resolve the specifier.
What do you see instead?
Awaiting a message in a loader hook stalls forever. The message never arrives and the engine never detects an unresolved promise.
Additional information
No 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 la riproduzione collegata del blocco del loader, index.mjs, su Node.js v23 e v24 per confermare la regressione. Analizza l’hook di risoluzione asincrono del module loader e il suo comportamento di scambio tramite MessagePort, quindi aggiungi un test di regressione che dimostri che il messaggio arriva e che la promise viene risolta nelle versioni correnti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100