redux-toolkit icon indicating copy to clipboard operation
redux-toolkit copied to clipboard

TypeError: RequestInit: Expected signal ("AbortSignal {}") to be an instance of AbortSignal.

Open MarcMcIntosh opened this issue 6 months ago • 5 comments

Happens when using node v24.0.0, with vitest, msw and jsdom.

Full error

An unhandled error occurred processing a request for the endpoint "ping".
In the case of an unhandled error, no tags will be "provided" or "invalidated". TypeError: RequestInit: Expected signal ("AbortSignal {}") to be an instance of AbortSignal.
    at Object.webidl.errors.exception (node:internal/deps/undici/undici:4096:14)
    at Object.AbortSignal (node:internal/deps/undici/undici:4338:31)
    at node:internal/deps/undici/undici:10747:41
    at node:internal/deps/undici/undici:4389:16
    at Object.RequestInit (node:internal/deps/undici/undici:4371:21)
    at new Request (node:internal/deps/undici/undici:10111:34)
    at Object.construct (file:///Users/marc/Projects/refact/refact-agent/gui/node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/utils/recordRawHeaders.ts:185:33)
    at file:///Users/marc/Projects/refact/refact-agent/gui/node_modules/@reduxjs/toolkit/src/query/fetchBaseQuery.ts:236:21
    at Object.queryFn (/Users/marc/Projects/refact/refact-agent/gui/src/services/refact/ping.ts:15:26)
    at executeRequest (file:///Users/marc/Projects/refact/refact-agent/gui/node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:308:20)

passes with node version 22

MarcMcIntosh avatar May 06 '25 19:05 MarcMcIntosh