#Unable to run dev after upgrading to V4

1 messages · Page 1 of 1 (latest)

crisp tide
#

I upgraded each package to @v4-beta versions. When I try to run dev, either using pnpm or npx I get package resolution errors. Attached are the error messages and you can find all source code to reproduce here: https://github.com/miguelh72/trigger-dev-demo

I'd be grateful for any help you can provide. Let me know if you'd like any more information or for me to host the source code.

P.S. My main reason for wanting to use v4 is to gain access to idempotency keys for triggerAndWait calls.

GitHub

Contribute to miguelh72/trigger-dev-demo development by creating an account on GitHub.

languid patrolBOT
#

Hi @crisp tide. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Thank you for providing details and the repository link. Based on the knowledge sources, here are some key points and troubleshooting steps for running Trigger.dev v4 in dev mode:

  1. Upgrade All Packages to v4-beta
    You must upgrade all your @trigger.dev/* packages to the @v4-beta version. This includes the main SDK and any other Trigger.dev packages you use. Use:

    npm add @trigger.dev/sdk@v4-beta -E
    

    Repeat for all @trigger.dev/* dependencies. Also, ensure you use the v4-beta CLI:

    npx trigger.dev@v4-beta dev
    

    Installation instructions

  2. CLI Usage
    While v4 is in beta, always use @v4-beta instead of @latest for CLI commands. For example:

    npx trigger.dev@v4-beta dev
    

    CLI usage

  3. Clear Build Cache
    If you encounter persistent errors, stop your local dev server, delete the hidden .trigger folder in your project, and restart the dev server. This can resolve issues caused by stale build artifacts.
    Troubleshooting: Clear the build cache

  4. Yarn Plug’n’Play Conflicts
    If you see package resolution errors and you’re using Yarn, check for a .pnp.cjs file in your home directory. Remove it if present, as it can cause dependency resolution issues.
    Troubleshooting: Yarn Plug’n’Play conflicts

  5. Package Resolution Errors
    The knowledge sources do not provide specific solutions for pnpm, but the general advice is to ensure all dependencies are on the correct version and to clear any caches that might cause conflicts.

#
  1. Idempotency Keys for triggerAndWait
    Please note: In v3.3.0 and later, the idempotencyKey option is not available for triggerAndWait or batchTriggerAndWait due to a bug. The documentation states that a fix is in progress, but does not confirm its availability in v4 yet. If your main reason for upgrading is to use idempotency keys with triggerAndWait, be aware that this feature may still be unavailable:

    In version 3.3.0 and later, the idempotencyKey option is not available when using triggerAndWait or batchTriggerAndWait, due to a bug that would sometimes cause the parent task to become stuck. We are working on a fix for this issue.
    Idempotency docs

Summary:

  • Double-check that all @trigger.dev/* packages and the CLI are on @v4-beta.
  • Clear the .trigger build cache.
  • Remove .pnp.cjs if using Yarn.
  • If you are using pnpm, try deleting node_modules and pnpm-lock.yaml and reinstalling.
  • The feature you want (idempotency keys for triggerAndWait) may not be available yet in v4.

If you continue to have issues, please provide the specific error messages you see, as the knowledge sources do not contain troubleshooting steps for all possible package resolution errors.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@crisp tide Kapa.ai is still learning and improving, please let me know how I did by reacting below.

crisp tide
#

I've tried the following from recommendations above:

  • Deleted node_modules and .trigger as well as ran pnpm store prune and tried again, same error
  • Verified that all @trigger.dev/* packages are on the @4-beta version