Skip to content

Node v24 errors with "TypeError: RequestInit: Expected signal to be an instance of AbortSignal." #1215

@amchappell9

Description

@amchappell9
The problem

When running tests with Node version 24.5.0, all tests fail with the following error:

 TypeError: RequestInit: Expected signal ("CustomAbortControllerSignal [EventTarget] {
      aborted: false,
      _onabort: null,
      _reason: undefined,
      _nativeCtrl: undefined,
      Symbol(events.maxEventTargetListeners): 0
    }") to be an instance of AbortSignal.

      at new NextRequest (node_modules/next/src/server/web/spec-extension/request.ts:38:10)
      at node_modules/next-test-api-route-handler/dist/src/index.js:138:57
      at handleNodeRequestAndResponse (node_modules/@whatwg-node/server/cjs/createServerAdapter.js:174:16)
      at node_modules/@whatwg-node/server/cjs/createServerAdapter.js:183:25
      at Promise.then (node_modules/@whatwg-node/promise-helpers/cjs/index.js:48:40)
      at requestListener (node_modules/@whatwg-node/server/cjs/createServerAdapter.js:183:14)
      at genericRequestHandler (node_modules/@whatwg-node/server/cjs/createServerAdapter.js:273:20)
      at Object.apply (node_modules/@whatwg-node/server/cjs/createServerAdapter.js:366:20)
      at Server.<anonymous> (node_modules/next-test-api-route-handler/dist/src/index.js:223:9)
Reproduction steps

Reproduction repo

Clone repo, then run npm install. Then run npm run test while using Node version 24 to reproduce error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions