You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FormData request body crashes with "Cannot read properties of undefined (reading '_buffer')" on jsdom 30.1.0 #841
Sending a FormData body (via axios, using the XHR interceptor under jsdom) throws
a TypeError when a Blob/File entry is present in the form, since upgrading
jsdom from 30.0.1 to 30.1.0. jsdom 30.0.1 works fine with the same test.
Stack trace
TypeError: Cannot read properties of undefined (reading '_buffer')
at invokeTheCallbackFunction (node_modules/jsdom/lib/generated/idl/Function.js:19:26)
at FormData.forEach (node_modules/jsdom/lib/generated/idl/FormData.js:420:18)
at Object.construct (node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/utils/recordRawHeaders.ts:207:32)
at new FetchRequest (node_modules/@mswjs/interceptors/src/utils/fetchUtils.ts:73:4)
at XMLHttpRequestController.toFetchApiRequest (node_modules/@mswjs/interceptors/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:675:25)
at XMLHttpRequest.methodCall (node_modules/@mswjs/interceptors/src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:170:38)
at Axios.request (node_modules/axios/lib/core/Axios.js:48:43)
Run under vitest (or Jest) with environment: "jsdom".
Expected behavior
The request goes through and the mocked response is returned, as it does on jsdom 30.0.1.
Environment
@mswjs/interceptors (via msw): 2.15.0
jsdom: 30.1.0 (30.0.1 is fine)
vitest: 4.1.11
Node: 24.19.0
Additional context
This looks like the same root cause as vitest-dev/vitest#11294 (jsdom renaming a private
field vitest's makeCompatBlob reads from Blob/File) — recordRawHeaders.ts
here reads a jsdom-internal _buffer field directly while iterating a FormData's entries, and that field appears to no longer be present as of
jsdom 30.1.0.
Hi @Greidal. Thanks for reporting. This doesn't seem like an issue with Interceptors. We aren't reading any internal properties on FormData or any other global APIs. Please raise this with JSDOM and kindly ask them to fix the bug.
Thanks for the quick look, and sorry for the bad lead - you're right, I had misread the stack trace as Interceptors reading an internal property. Confirmed it isn't: I reproduced the crash with no Interceptors/msw/axios involved at all, just
under vitest's jsdom environment (vitest@4.1.11, jsdom@30.1.0, Node 24.19.0) - same Cannot read properties of undefined (reading '_buffer') at invokeTheCallbackFunction/FormData.forEach inside jsdom itself. Filing against jsdom with this repro. Thanks again, and apologies for the noise here.
Correction to my last comment: it wasn't jsdom either. Traced it further to vitest's own jsdom-environment compat shim (makeCompatBlob/makeCompatFormData in packages/vitest/src/integrations/env/jsdom.ts) - it locates jsdom's internal Blob storage via a brittle Object.getOwnPropertySymbols(...)[0] heuristic that no longer resolves on jsdom 30.1.0. Closed the jsdom issue, filed the real findings at vitest-dev/vitest#11294 (reopening a previously-closed-but-insufficiently-fixed issue there). Sorry again for the back-and-forth.
Activity
kettanaito commentedon Sep 21, 2026
Hi @Greidal. Thanks for reporting. This doesn't seem like an issue with Interceptors. We aren't reading any internal properties on
FormDataor any other global APIs. Please raise this with JSDOM and kindly ask them to fix the bug.Greidal commentedon Sep 21, 2026
Thanks for the quick look, and sorry for the bad lead - you're right, I had misread the stack trace as Interceptors reading an internal property. Confirmed it isn't: I reproduced the crash with no Interceptors/msw/axios involved at all, just
under
vitest's jsdom environment (vitest@4.1.11,jsdom@30.1.0, Node 24.19.0) - sameCannot read properties of undefined (reading '_buffer')atinvokeTheCallbackFunction/FormData.forEachinside jsdom itself. Filing against jsdom with this repro. Thanks again, and apologies for the noise here.Greidal commentedon Sep 21, 2026
Filed as jsdom/jsdom#4361.
Greidal commentedon Sep 21, 2026
Correction to my last comment: it wasn't jsdom either. Traced it further to vitest's own jsdom-environment compat shim (
makeCompatBlob/makeCompatFormDatainpackages/vitest/src/integrations/env/jsdom.ts) - it locates jsdom's internal Blob storage via a brittleObject.getOwnPropertySymbols(...)[0]heuristic that no longer resolves on jsdom 30.1.0. Closed the jsdom issue, filed the real findings at vitest-dev/vitest#11294 (reopening a previously-closed-but-insufficiently-fixed issue there). Sorry again for the back-and-forth.kettanaito commentedon Sep 22, 2026
Ha! Interesting find. Thanks for looking into it, @Greidal.