Loader stalls MessagePort since v24
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked loader-stall reproduction, index.mjs, on Node.js v23 and v24 to confirm the regression. Investigate the module loader's async resolve hook and its MessagePort exchange behavior, then add a regression test showing that the message arrives and the promise resolves on current versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100