Skip to content
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

Type instantiation is excessively deep and possibly infinite. #187

Closed
Richard87 opened this issue Jul 23, 2023 · 4 comments
Closed

Type instantiation is excessively deep and possibly infinite. #187

Richard87 opened this issue Jul 23, 2023 · 4 comments

Comments

@Richard87
Copy link

Do you have any advice on how to deal with this error?

I got the new error after adding a few endpoints to the api:


./pages/me/profile.tsx:18:13
Type error: Type instantiation is excessively deep and possibly infinite.

  16 |   const onSaveName = async (e) => {
  17 |     try {
> 18 |       await apiClient.post("/api/members/change-name", {
     |             ^
  19 |         name: e.target.value,
  20 |         memberId: memberId
  21 |       })
- info Linting and checking validity of types ..%            

openapi.yaml.zip

A short discussion about the issue here: microsoft/TypeScript#34933

@astahmer
Copy link
Owner

Not sure but this seems more of a typescript / zodios issue rather than openapi-zod-client one ?

@jwyce
Copy link

jwyce commented Jul 24, 2023

Seems like zodios (and typescript) has a limit for how complex your api can be in a single client: ecyrbe/zodios#256. I don't know how we could solve this besides breaking up the generated client into multiple pieces like that issue suggests, which isn't ideal 🤔

@Richard87
Copy link
Author

Yeah, i was just thinking about it and its probably a Zodios issue, but there is not many endpoints, probably 10-15 with 'flat' apis, no neste content, and absolutley no recursion 😕

@Richard87
Copy link
Author

Closing the issue here and opening it a new one in Zodios instead...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants