Error: Uncaught [TypeError: FormData constructor: Argument 1 could not be converted to: undefined.]? #1919
Unanswered
Abdulmajeed98
asked this question in
Q&A
Replies: 3 comments 10 replies
-
@Abdulmajeed98 can you make a small reproduction of the issue? this would help with diagnosing the issue |
Beta Was this translation helpful? Give feedback.
10 replies
-
I was able to sort that out by removing const { TextDecoder, TextEncoder } = require('node:util');
Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
});
const { Blob, File } = require('node:buffer');
const { fetch, Headers, Request, Response } = require('undici');
Object.defineProperties(globalThis, {
fetch: { value: fetch, writable: true },
Blob: { value: Blob },
File: { value: File },
Headers: { value: Headers },
Request: { value: Request },
Response: { value: Response },
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I met this error with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After upgrading from
v1
tov2
and adding the properjest.polyfills.js
as it is mentioned here.Now I am getting a different error when I run my jest test cases, which is this one
Error: Uncaught [TypeError: FormData constructor: Argument 1 could not be converted to: undefined.]
.Any help on this issue?
I couldn't find a similar problem from
issues
orFAQ
of the website.Beta Was this translation helpful? Give feedback.
All reactions