bug: Typescript Error for Invoke Trigger with Zod schema
Provide environment information
System: OS: macOS 11.7.5 CPU: (8) x64 Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz Memory: 153.83 MB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 18.17.1 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 9.6.7 - /usr/local/bin/npm Watchman: 2023.02.27.00 - /usr/local/bin/watchman
Describe the bug
TypeScript: Type instantiation is excessively deep and possibly infinite
Reproduction repo
N/A
To reproduce
Create a new job with invokeTrigger and provide Zod schema to it
Additional information
No response
Hi @michalkow, this is such an annoying issue that we don't think we can fix from our side…
But you can fix it from your end by changing your Zod version to "3.22.3".
I updated Zod, but the issue is still there. I had the same problem in eventTrigger, but this fixed it for me: https://github.com/triggerdotdev/trigger.dev/pull/500
Installing zod 3.22.3 fixed it for me!
It seems to be broken again in 3.22.4. Reverting to 3.22.3 resolved.
Same problem and this fixed the problem:
It seems to be broken again in 3.22.4. Reverting to 3.22.3 resolved.
You don't have to revert specifically but you can set it with Yarn Resolutions.
However, this is frustrating, this repo should set this as a peer dependency so that we don't need to do this specifically. We use other packages that also depend on zod such as the @langchain/* packages.
Same here. But I can use the same schema for eventTrigger.
same issue 3.23.6