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
The FormData type that is part of the BodyInit union is imported from the form-data npm package. Perhaps this is an issue with the type definition of that package or the dependency needs to be upgraded. It seems to have gone up a whole major version since it was added as a dependency.
From what I can tell, the issue you're linking to is related to a browser environment, whereas node-fetch is a node library and I'm unsure how it is relevant.
Your screenshot doesn't reveal how you're constructing body, making it difficult to analyze the problem further. Are you sure this isn't a question that should be posted in the library's Github issues?
Just had this problem. @tayloraucoin as per @nikcorg's comment, this can be resolved by simply adding import FormData from 'form-data' to your file's imports. The source of the error is from the fact the FormData type present in form-data and the FormData type present in Typescript's own browser type definitions don't have any overlap, giving you this type error.
Is something wrong with CI or publishing infrastructure?
If you know how to fix the issue, make a pull request instead.
@types/node-fetch
package and had problems.@types
package versions do not follow SemVer.Definitions by:
inindex.d.ts
) so they can respond.If you do not mention the authors the issue will be ignored.
Hey maintainers,
Seems like
FormData
should easily be accepted byBodyInit
in@types/node-fetch
.string
works fine.Missing something? Or a bug?
Not sure what the
URLSearchParams
is about. Looks like there is some related discussion on the topic: microsoft/TypeScript#30584https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node-fetch/index.d.ts
Thanks!
The text was updated successfully, but these errors were encountered: