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

Possible regression in 2.9.0 #144

Closed
mhio opened this issue May 24, 2023 · 10 comments
Closed

Possible regression in 2.9.0 #144

mhio opened this issue May 24, 2023 · 10 comments

Comments

@mhio
Copy link

mhio commented May 24, 2023

When using json-schema-to-ts via @fastify/fastify-type-provider-json-schema-to-ts the 2.9.0 release is producing issues converting schemas to types.

I only raise this issue here as 2.9.0 doesn't appear to be a feature release, just a change in the release process, so I thought a change in behaviour would be of interest here.

fastify/fastify-type-provider-json-schema-to-ts#49

Similar to #132 but I couldn't reproduce the issue in fastify-type-provider-json-schema-to-ts depending on 2.8.0, 2.8.1 or 2.8.2 so appears on the surface to be something different.

@aardvarkk
Copy link

I'm seeing the same issue as Fastify around "Type instatiation is excessively deep and possibly infinite". Reverting to v2.8 fixes the issue.

@ThomasAribart
Copy link
Owner

ThomasAribart commented May 25, 2023

Thanks for the heads up! Very weird indeed as there has been no change in the source code between 2.8.2 and 2.9, only CI/CD stuff. Will be looking at that tomorrow, meanwhile feel free to stay on 2.8.2!

@tizmagik
Copy link

I was getting this same error and I had to downgrade to exactly 2.8.0 for it to work. TypeScript v5.0.4

@Physicliar
Copy link

I am using serverless framework aws-serverless-typescript template and getting the same error event 2.8.0 or 2.9.0 or even 2.7.0.

TypeScript v5.0.4

@ThomasAribart
Copy link
Owner

@Physicliar It was fixed in 2.8.2 I think

@ThomasAribart
Copy link
Owner

ThomasAribart commented May 27, 2023

Just looked at it, the builds of 2.8.2 and 2.9.0 are exactly the same, except that in 2.8.2, all types are declared and not in 2.9.0.

yo ts — castore (Workspace) 2023-05-27 11-29-43

I'm not sure why exactly, but it's probably what caused the regression (it's the only diff I see anyway). It seems it came from using the v4.9.5 of TS to build the types instead of the ^4.5.5. Will try to fix that ASAP.

@ThomasAribart
Copy link
Owner

ThomasAribart commented May 27, 2023

@mhio @aardvarkk @tizmagik @Physicliar Can you try with 2.9.1 ? The declares are now back so the code should be exactly the same as 2.8.2.

Strangely, it also solved a deno build issue (here 2.9.0 vs 2.9.1):

v2 9 0 🌈 · ThomasAribart:json-schema-to-ts@e211f20 2023-05-27 12-01-14 v2 9 1 🌈 · ThomasAribart:json-schema-to-ts@01f639b 2023-05-27 12-00-23

@aardvarkk
Copy link

@ThomasAribart I can confirm that upgrading from 2.9.0 to 2.9.1 fixes the "Type instantiation is excessively deep and possibly infinite" issue for me.

@ThomasAribart
Copy link
Owner

Great 👍 Closing this issue then!

@mhio
Copy link
Author

mhio commented May 29, 2023

Thanks Thomas!

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

5 participants