We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Node 18 the standards-compliant undici fetch is available, and it accepts Node's Readable Stream as a body as well as the standard Web Streams.
The problem is that new FormData() doesn't return an object that is recognized as a Readable.
new FormData()
Readable
Workaround:
import {PassThrough} from 'stream' // ... const pt = new PassThrough() formData.pipe(pt) fetch(url, { // ... body: pt })
You can test the problem in Node 18 by running the following, which will throw:
import {Readable} from 'stream' // ... Readable.toWeb(formData)
Probably Readable needs to be in the prototype chain?
The text was updated successfully, but these errors were encountered:
instead of using form-data use the FormData provided by nodejs/undici itself
Sorry, something went wrong.
@jimmywarting and forego all the nice features?
like what features?
No branches or pull requests
In Node 18 the standards-compliant undici fetch is available, and it accepts Node's Readable Stream as a body as well as the standard Web Streams.
The problem is that
new FormData()
doesn't return an object that is recognized as aReadable
.Workaround:
You can test the problem in Node 18 by running the following, which will throw:
Probably Readable needs to be in the prototype chain?
The text was updated successfully, but these errors were encountered: