fredericbarthelet / typebridge

Typescript toolbox for AWS EventBridge
76 stars 10 forks source link

PublishedEvent type can't be instantiated #23

Open CorentinDoue opened 8 months ago

CorentinDoue commented 8 months ago

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:

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

CorentinDoue commented 8 months ago

@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