Skip to content

fix: temporary fix for node-spdy error in Node.js >= v24 #13041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GoodbyeNJN
Copy link
Contributor

When running the max script in a Node.js >= v24 environment it reports an error:

fatal - Error: Register plugin /project/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]__9b20205c8c9c9f15081a9ea7104195c0/node_modules/@umijs/preset-umi/dist/features/esmi/esmi.js failed, since No such module: http_parser
    at Plugin.apply (/project/node_modules/.pnpm/@[email protected]/node_modules/@umijs/core/dist/service/plugin.js:76:15)
    at Service.initPlugin (/project/node_modules/.pnpm/@[email protected]/node_modules/@umijs/core/dist/service/service.js:463:33)
    at Service.run (/project/node_modules/.pnpm/@[email protected]/node_modules/@umijs/core/dist/service/service.js:259:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Service.run2 (/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]_je_b3e3ee8efb31833b8e8afda8bbdef0b0/node_modules/umi/dist/service/service.js:65:12)
    at async run (/project/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]_je_b3e3ee8efb31833b8e8afda8bbdef0b0/node_modules/umi/dist/cli/cli.js:56:7) {
  [cause]: Error: No such module: http_parser
      at process.binding (node:internal/bootstrap/realm:162:11)
      at Object.<anonymous> (/project/node_modules/.pnpm/[email protected]/node_modules/http-deceiver/lib/deceiver.js:22:24)
      at Module._compile (node:internal/modules/cjs/loader:1734:14)
      at Object..js (node:internal/modules/cjs/loader:1899:10)
      at Module.load (node:internal/modules/cjs/loader:1469:32)
      at Module._load (node:internal/modules/cjs/loader:1286:12)
      at TracingChannel.traceSync (node:diagnostics_channel:322:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
      at Module.require (node:internal/modules/cjs/loader:1491:12)
      at require (node:internal/modules/helpers:135:16)
}
fatal - A complete log of this run can be found in:
fatal - /project/node_modules/.cache/logger/umi.log
fatal - Consider reporting a GitHub issue on https://github.com/umijs/umi/issues
fatal - 如果你需要进交流群,请访问 https://fb.umijs.org 。

Inspection revealed that the error was coming from the spdy dependency package, whose internal dependency package http-deceiver used the deprecated method process.binding, which was completely removed in Node.js v24.

This change is intended to change the static import of the spdy dependency to a dynamic import on invocation, which may temporarily solve the problem of errors when running the max script. However, a better solution would be to remove the dependency on this package completely and use the node:http2 module instead, which should be stable enough.

References:

Copy link

vercel bot commented May 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
umi ⬜️ Ignored (Inspect) Visit Preview May 20, 2025 9:51am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant