-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
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
TypeScript Error with @hey-api/openapi-ts Generated Files #1746
Comments
@fradal64 Did you ensure your client is updated to the latest (or correct) version? |
I encountered the same issue initially, but updating my version resolved it. "@hey-api/client-axios": "^0.6.1",
"@hey-api/openapi-ts": "^0.64.5", Please make sure you are using the latest version. |
I had in fact outdated versions but now that I have updated them I still get the same error. These are the new versions I have installed.
|
@fradal64 please share a reproducible example and I can have a look |
@mrlubos thank you so much. I have tried to regenerate the client folder after upgrading to the latest versions of the packages and now I get the following error:
Here is my main file where I set the client:
This used to work fine with the previous versions of the package but now it isn't working anymore. |
@fradal64 I suspect you didn't look at the migration notes 🤠 https://heyapi.dev/openapi-ts/migrating |
Description
I am encountering a TypeScript error when generating files with openapi-ts. The error message is as follows:
Here is an example of one of the automatically generated code snippets causing the error:
export const getCurrentUser = <ThrowOnError extends boolean = false>(options?: Options<GetCurrentUserData, ThrowOnError>) => { return (options?.client ?? client).get<GetCurrentUserResponse, unknown, ThrowOnError>({ security: [ { scheme: 'bearer', type: 'http' } ], url: '/api/auth/users/me', ...options }); };
The text was updated successfully, but these errors were encountered: