nodejs / nodejs/node

Loader stalls MessagePort since v24

Offen
#63,085 3 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Führe zunächst die verknüpfte Reproduktion des Loader-Stalls, index.mjs, unter Node.js v23 und v24 aus, um die Regression zu bestätigen. Untersuche den asynchronen Resolve-Hook des Modul-Loaders und sein Austauschverhalten über MessagePort. Füge anschließend einen Regressionstest hinzu, der zeigt, dass die Nachricht eintrifft und das Promise unter aktuellen Versionen aufgelöst wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.