Skip to content

[TRI-1230] TypeScript "Type instantiation is excessively deep and possibly infinite.ts(2589)" error when using eventTrigger w/zod schema (different Zod versions) #436

Closed

Description

@ericallam

When using the eventTrigger with zod to define the event schema TypeScript gives this error:

This only seems to be happening in Next.js projects created with create-t3-app. I've reproduced it here:

https://github.com/ericallam/t3-trigger-app/blob/bbade197052ae5d790c7b46509628a5c8d57ba94/src/jobs/examples.ts#L19

We need to track down the issue and figure out how to fix it (or provide a workaround for t3-app)

From SyncLinear.com | TRI-1230

Activity

  1. ghost added
    bug
    on Sep 5, 2023
  2. ghost added
    area/server
    on Sep 5, 2023
  3. changed the title [-]TypeScript "possibly infinite" error when using eventTrigger w/zod schema and create-t3-app[/-] [+][TRI-1230] TypeScript "possibly infinite" error when using eventTrigger w/zod schema and create-t3-app[/+] on Sep 5, 2023
  4. ericallam commented on Sep 5, 2023

    @ericallam
    MemberAuthor

    /bounty $150

  5. algora-pbc commented on Sep 5, 2023

    @algora-pbc

    💎 $150 bounty created by ericallam
    🙋 If you'd like to work on this issue, comment below to get assigned
    👉 To claim this bounty, submit a pull request that includes the text /claim #436 somewhere in its body
    📝 Before proceeding, please make sure you can receive payouts in your country
    💵 Payment arrives in your account 2-5 days after the bounty is rewarded
    💯 You keep 100% of the bounty award
    🙏 Thank you for contributing to triggerdotdev/trigger.dev!

  6. Chigala commented on Sep 5, 2023

    @Chigala
    Contributor

    /attempt #436

    Options
  7. algora-pbc commented on Sep 5, 2023

    @algora-pbc

    @Chigala is already attempting to complete #436 and claim the bounty. If you attempt to complete the same issue, there is a chance that @Chigala will complete the issue first, and be awarded the bounty. Try discussing with @Chigala and potentially collaborating on the same solution versus creating an alternate solution.

  8. algora-pbc commented on Sep 12, 2023

    @algora-pbc

    @Chigala: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

  9. algora-pbc commented on Sep 12, 2023

    @algora-pbc

    @ayusham001: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏

  10. changed the title [-][TRI-1230] TypeScript "possibly infinite" error when using eventTrigger w/zod schema and create-t3-app[/-] [+][TRI-1230] TypeScript "Type instantiation is excessively deep and possibly infinite.ts(2589)" error when using eventTrigger w/zod schema and create-t3-app[/+] on Sep 18, 2023
  11. changed the title [-][TRI-1230] TypeScript "Type instantiation is excessively deep and possibly infinite.ts(2589)" error when using eventTrigger w/zod schema and create-t3-app[/-] [+][TRI-1230] TypeScript "Type instantiation is excessively deep and possibly infinite.ts(2589)" error when using eventTrigger w/zod schema (different Zod versions)[/+] on Sep 18, 2023
  12. matt-aitken commented on Sep 18, 2023

    @matt-aitken
    Member

    This seems to be happening when the @trigger.dev/sdk zod dependency is a different version from the project's dependency.

    Switching to a peer dependency with a range should fix this?

  13. ericallam commented on Sep 18, 2023

    @ericallam
    MemberAuthor

    It would be great to track down exactly what the issue is and:

    1. Document the issue
    2. Open an issue on Zod repo with with a reproduction repo
    3. If there is a way for us to fix the issue, do that as well
  14. algora-pbc commented on Sep 19, 2023

    @algora-pbc

    The bounty is up for grabs! Everyone is welcome to /attempt #436 🙌

  15. nicktrn commented on Nov 1, 2023

    @nicktrn
    Collaborator

    Fixed by #500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/integrationsarea/serverbug💎 Bounty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions