nodejs / nodejs/node

node:test and async register hooks broken after 24.12.0

未关闭
#62,104 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
122k
派生
37.3k
平均合并
4 天 2 小时
30 天内合并 PR
283

描述

Version

24.12.0

Platform
Darwin MSK-G4LQ6YF03T.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 21:59:23 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T6030 arm64
Subsystem

No response

What steps will reproduce the bug?
Context

Hi, I have small TS loader for Node.js:
https://github.com/krutoo/ts-loader

I use it like:

npm i ts-loader@npm:@krutoo/ts-loader
node --import ts-loader ./test.ts

You can see real example with issue here:
https://github.com/krutoo/utils/pull/212

Under the hood loader just runs http server in first process and registers hooks by module.register

Hooks uses fetch to request server to complie modules

Problem

After upgrade to Node.js 24.12.0 server don't answer any requests, even from browser, there is tab that waits for response

I don't have skills to figure out the cause myself.

Tried log some steps, seems the server isn't accepting any incoming requests at all.

Even though the server itself has definitely been created, has taken over the port, and is accepting messages.

Can someone help to understand cause of this behavior?

How often does it reproduce? Is there a required condition?

Clone this repo and branch:
https://github.com/krutoo/utils/tree/tsimp-replaced

Then:

nvm install 24.12.0

npm use 24.12.0

npm i

npm run test
What is the expected behavior? Why is that the expected behavior?

Don't have enough skills to understand it is a bug or new behavior of async loader hooks

What do you see instead?

Tests freezes

Additional information

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 krutoo/utils 中链接的 tsimp-replaced 分支及其 npm test 命令,在 Node.js 24.12.0 上重现 freeze,然后将行为与 krutoo/ts-loader 中描述的 loader 进行比较。调查 module.register 的异步钩子以及基于 fetch 的服务器请求;当测试套件完成且升级后 loader 服务器能够响应请求时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js, typescript
领域
backend, devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。