kubb-labs / kubb

OpenAPI to TypeScript, React-Query, Zod, Zodios, Faker.js, MSW and Axios.
https://kubb.dev
MIT License
552 stars 38 forks source link

FormData Typescript error when autogenerating react-query mutations #1064

Closed gentrith44belt closed 52 minutes ago

gentrith44belt commented 5 days ago

What version of kubb is running?

2.21.0

What platform is your computer?

macOS

What version of external packages are you using(@tanstack-query, MSW, React, Vue, ...)

5.48.0

What steps can reproduce the bug?

Maybe there is a way to bypass this, but it breaks builds and I didn't see a way to override it from the kubb config. The commented code is one of the solutions.

image

How often does this bug happen?

None

What is the expected behavior?

// (Object.keys(data) as Array).forEach((key) => { // const value = data[key]; // if (typeof key === "string" && (typeof value === "string" || value instanceof Blob)) { // formData.append(key, value); // } // });

Swagger/OpenAPI file?

No response

Additional information

No response

stijnvanhulle commented 4 days ago

https://github.com/kubb-labs/kubb/issues/1044

stijnvanhulle commented 52 minutes ago

'v.2.22.1' will resolve this.