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

FromExtendedSchema fails to compile #132

Closed
royhamulak opened this issue Apr 19, 2023 · 3 comments · Fixed by #136
Closed

FromExtendedSchema fails to compile #132

royhamulak opened this issue Apr 19, 2023 · 3 comments · Fixed by #136

Comments

@royhamulak
Copy link

royhamulak commented Apr 19, 2023

PR#130 introduced FromExtendedSchema

when installing version 2.8.0 and trying to build my project I was getting the following error:

node_modules/json-schema-to-ts/lib/types/index.d.ts:16:314 - error TS2590: Expression produces a union type that is too complex to represent.
16 export declare type FromExtendedSchema<E extends JSONSchema7Extension, S extends ExtendedJSONSchema<E>, Opt extends FromExtendedSchemaOptions<E> = FromSchemaDefaultOptions, W extends $ExtendedJSONSchema7<E> = Cast<S extends Record<string | number | symbol, unknown> ? Writable<S> : S, $ExtendedJSONSchema7<E>>> = FromSchema<Cast<UnextendJSONSchema7<E, W>, JSONSchema>, Opt>;

I was using typescript 5 as it wasn't supposed to mess with anything on my side but seems like it doesn't like this new type

@royhamulak royhamulak changed the title FromExtendedSchema fails to compile with typescript 5 FromExtendedSchema fails to compile Apr 19, 2023
@ronyehu
Copy link

ronyehu commented Apr 20, 2023

this is very critical as any sub-dependency that uses this, upon update fails to build.
please resolve this asap!
Thanks!

@stebl
Copy link

stebl commented May 5, 2023

I ran into this with json-schema-to-ts 2.6.2. It was the upgrade to TS 5.x that surfaced the compilation error. In my case I'm able to continue using TS 4.9.5 for the time being.

my-repo
|- my-package
|  |- json-schema-to-ts 2.6.2
|- TS 5.0.4

Compilation in my-repo fails.

@ThomasAribart
Copy link
Owner

Should be fixed in 2.8.2

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

Successfully merging a pull request may close this issue.

4 participants