trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Typescript Error for Invoke Trigger with Zod schema

Open michalkow opened this issue 2 years ago • 8 comments

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 Screenshot 2023-11-09 at 11 19 23

Reproduction repo

N/A

To reproduce

Create a new job with invokeTrigger and provide Zod schema to it

Additional information

No response

michalkow avatar Nov 09 '23 10:11 michalkow

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".

matt-aitken avatar Nov 09 '23 10:11 matt-aitken

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

michalkow avatar Nov 09 '23 19:11 michalkow

Installing zod 3.22.3 fixed it for me!

maoosi avatar Nov 20 '23 07:11 maoosi

It seems to be broken again in 3.22.4. Reverting to 3.22.3 resolved.

HeathHopkins avatar Jan 05 '24 03:01 HeathHopkins

Same problem and this fixed the problem:

It seems to be broken again in 3.22.4. Reverting to 3.22.3 resolved.

0xtlt avatar Mar 12 '24 17:03 0xtlt

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.

jpgilchrist avatar Mar 12 '24 18:03 jpgilchrist

Same here. But I can use the same schema for eventTrigger.

ImSingee avatar Apr 01 '24 20:04 ImSingee

same issue 3.23.6

devnomic avatar May 03 '24 06:05 devnomic