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 11 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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After upgrading from
v1tov2and adding the properjest.polyfills.jsas 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
issuesorFAQof the website.Beta Was this translation helpful? Give feedback.
All reactions