Development
EACCES: permission denied
If you see this error:
Clear the build cache
Ensure you have stopped your local dev server then locate the hidden.trigger
folder in your project and delete it. You can then restart your local dev server.
Yarn Plug’n’Play conflicts
If you see errors like this when runningtrigger.dev dev
:
.pnp.cjs
file in your home directory. This can happen if you previously had Yarn Plug’n’Play enabled globally. Remove the .pnp.cjs
file to resolve the issue.
Deployment
Running the [trigger.dev deploy] command builds and deploys your code. Sometimes there can be issues building your code. You can run the deploy command with--log-level debug
at the end. This will spit out a lot of information about the deploy. If you can’t figure out the problem from the information below please join our Discord and create a help forum post. Do NOT share the extended debug logs publicly as they might reveal private information about your project.
You can also review the build by supplying the --dry-run
flag. This will build your project but not deploy it. You can then inspect the build output on your machine.
Here are some common problems and their solutions:
Failed to build project image: Error building image
There should be a link below the error message to the full build logs on your machine. Take a look at these to see what went wrong. Join our Discord and you share it privately with us if you can’t figure out what’s going wrong. Do NOT share these publicly as the verbose logs might reveal private information about your project.
Error: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1
If you see this error after uninstalling Docker Desktop:
~/.docker/config.json
file. You don’t need Docker Desktop installed to use Trigger.dev.
Deployment encountered an error
Usually there will be some useful guidance below this message. If you can’t figure out what’s going wrong then join our Discord and create a Help forum post with a link to your deployment.
No loader is configured for ".node" files
This happens because .node
files are native code and can’t be bundled like other packages. To fix this, add your package to build.external
in the trigger.config.ts
file like this:
trigger.config.ts
Cannot find module '/app/lib/worker.js"
when using pino
If you see this error, add pino (and any other associated packages) to your external
build settings in your trigger.config.ts
file. Learn more about the external
setting in the config docs.
reactDOMServer.renderToPipeableStream is not a function
when using react-email
If you see this error when using @react-email/render
:
external
build settings in your trigger.config.ts
file:
trigger.config.ts
Cannot find matching keyid
This error occurs when using Node.js v22 with corepack, as it’s not yet compatible with the latest package manager signatures. To fix this, either:
- Downgrade to Node.js v20 (LTS), or
- Install corepack globally:
npm i -g corepack@latest
Project setup issues
The requested module 'node:events' does not provide an export named 'addAbortListener'
If you see this error it means you’re not a supported version of Node:
Version | Minimum |
---|---|
18 | 18.20+ |
20 | 20.5+ |
21 | 21.0+ |
22 | 22.0+ |
Runtime issues
Environment variable not found:
Your code is deployed separately from the rest of your app(s) so you need to make sure that you set any environment variables you use in your tasks in the Trigger.dev dashboard. Read the guide.
Error: @prisma/client did not initialize yet.
Prisma uses code generation to create the client from your schema file. This means you need to add a bit of config so we can generate this file before your tasks run: Read the guide.
Parallel waits are not supported
In the current version, you can’t perform more that one “wait” in parallel.
Waits include:
wait.for()
wait.until()
task.triggerAndWait()
task.batchTriggerAndWait()
- And any of our functions with
wait
in the name.
Promise.all
around some of our wait functions. Instead of doing this use our built-in functions for triggering tasks. We have functions that allow you to trigger different tasks in parallel.
When triggering subtasks the parent task finishes too soon
Make sure that you always useawait
when you call trigger
, triggerAndWait
, batchTrigger
, and batchTriggerAndWait
. If you don’t then it’s likely the task(s) won’t be triggered because the calling function process can be terminated before the networks calls are sent.
Rate limit exceeded
The most common cause of hitting the API rate limit is if you’re callingtrigger()
on a task in a loop, instead of doing this use batchTrigger()
which will trigger multiple tasks in a single API call. You can have up to 500 tasks in a single batch trigger call.
View the rate limits page for more information.
Crypto is not defined
This can happen in different situations, for example when using plain strings as idempotency keys. Support for Crypto
without a special flag was added in Node v19.0.0
. You will have to upgrade Node - we recommend even-numbered major releases, e.g. v20
or v22
. Alternatively, you can switch from plain strings to the idempotencyKeys.create
SDK function. Read the guide.
Task run stalled executing
If you see aTASK_RUN_STALLED_EXECUTING
error it means that we didn’t receive a heartbeat from your task before the stall timeout. We automatically heartbeat runs every 30 seconds, and the heartbeat timeout is 10 minutes.
If this was a dev run, then most likely the
trigger.dev dev
CLI was stopped, and it wasn’t an issue with your code.heartbeats.yield
function to automatically yield to the event loop periodically:
You could also offload the CPU-heavy work to a Node.js worker thread, but this is more complex to setup currently. We are planning on adding support for this in the future.
Framework specific issues
NestJS swallows all errors/exceptions
If you’re using NestJS and you add code like this into your tasks you will prevent any errors from being surfaced:React is not defined
If you see this error:Next.js build failing due to missing API key in GitHub CI
This issue occurs during the Next.js app build process on GitHub CI where the Trigger.dev SDK is expecting the TRIGGER_SECRET_KEY environment variable to be set at build time. Next.js attempts to compile routes and creates static pages, which can cause issues with SDKs that require runtime environment variables. The solution is to mark the relevant pages as dynamic to prevent Next.js from trying to make them static. You can do this by adding the following line to the route file:Correctly passing event handlers to React components
An issue can sometimes arise when you try to pass a function directly to theonClick
prop. This is because the function may require specific arguments or context that are not available when the event occurs. By wrapping the function call in an arrow function, you ensure that the handler is called with the correct context and any necessary arguments. For example:
This works: