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

PublishedEvent type can't be instantiated #23

Open
CorentinDoue opened this issue Mar 7, 2024 · 1 comment
Open

PublishedEvent type can't be instantiated #23

CorentinDoue opened this issue Mar 7, 2024 · 1 comment

Comments

@CorentinDoue
Copy link

CorentinDoue commented Mar 7, 2024

In my last project, PublishedEvent<typeof MyEvent> ends with TS2589: Type instantiation is excessively deep and possibly infinite.

However, the type seems correctly inferred:
image

I can also recreate the PublishedEvent type locally and it works:
image

Minimal reproduction could be found here: https://github.com/CorentinDoue/typebridge-error-repro

I tried to downgrade the following dependencies:

  • typescript: 4.9
  • json-schema-to-ts: 2.12.0

But I couldn't manage to make it work again, so I don't know what was the breaking change.

@CorentinDoue
Copy link
Author

@PChol22 just told me that's an issue with a breaking version of https://github.com/ThomasAribart/json-schema-to-ts

The workaround is to fix json-schema-to-ts version to v2.5.1 and typebridge to v1.1.0. The last version of typebridge sets json-schema-to-ts version to ^2.5.5 which gets the breaking change

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

1 participant