diff --git a/docs/config/config-file.mdx b/docs/config/config-file.mdx index 28903af710..7acef7f0f6 100644 --- a/docs/config/config-file.mdx +++ b/docs/config/config-file.mdx @@ -659,6 +659,8 @@ export default defineConfig({ This extension will also add the `FFMPEG_PATH` and `FFPROBE_PATH` to your environment variables, making it easy to use popular ffmpeg libraries like `fluent-ffmpeg`. +Note that `fluent-ffmpeg` needs to be added to [`external`](/config/config-file#external) in your `trigger.config.ts` file. + Follow [this example](/guides/examples/ffmpeg-video-processing) to get setup with Trigger.dev and FFmpeg in your project. #### esbuild plugins diff --git a/docs/docs.json b/docs/docs.json index d090992cae..b5dd580178 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -183,6 +183,7 @@ "group": "Troubleshooting", "pages": [ "troubleshooting", + "troubleshooting-debugging-in-vscode", "upgrading-packages", "upgrading-beta", "troubleshooting-alerts", diff --git a/docs/guides/examples/ffmpeg-video-processing.mdx b/docs/guides/examples/ffmpeg-video-processing.mdx index 229c9c0907..fa18b2d323 100644 --- a/docs/guides/examples/ffmpeg-video-processing.mdx +++ b/docs/guides/examples/ffmpeg-video-processing.mdx @@ -36,6 +36,8 @@ export default defineConfig({ You'll also need to add `@trigger.dev/build` to your `package.json` file under `devDependencies` if you don't already have it there. +If you are modifying this example and using popular FFmpeg libraries like `fluent-ffmpeg` you'll also need to add them to [`external`](/config/config-file#external) in your `trigger.config.ts` file. + ## Compress a video using FFmpeg This task demonstrates how to use FFmpeg to compress a video, reducing its file size while maintaining reasonable quality, and upload the compressed video to R2 storage. diff --git a/docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx b/docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx index e018277cec..d6fbfbc81d 100644 --- a/docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx +++ b/docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx @@ -270,6 +270,8 @@ export default defineConfig({ if you don't already have it there. +If you are modifying this example and using popular FFmpeg libraries like `fluent-ffmpeg` you'll also need to add them to [`external`](/config/config-file#external) in your `trigger.config.ts` file. + ### Add your Deepgram and Supabase environment variables to your Trigger.dev project You will need to add your `DEEPGRAM_SECRET_KEY`, `SUPABASE_PROJECT_URL` and `SUPABASE_SERVICE_ROLE_KEY` as environment variables in your Trigger.dev project. This can be done in the 'Environment Variables' page in your project dashboard. diff --git a/docs/introduction.mdx b/docs/introduction.mdx index de4f0c078f..13474e0230 100644 --- a/docs/introduction.mdx +++ b/docs/introduction.mdx @@ -24,7 +24,7 @@ mode: "center" Trigger.dev is an open source background jobs framework that lets you write reliable workflows in plain async code. Run long-running AI tasks, handle complex background jobs, and build AI agents with built-in queuing, automatic retries, and real-time monitoring. No timeouts, elastic scaling, and zero infrastructure management required. -We provide everything you need to build and manage background tasks: a [CLI and SDK](/config/config-file) for writing tasks in your existing codebase, support for both [regular](/tasks/overview) and [scheduled](/tasks/scheduled) tasks, full observability through our dashboard, and a [Realtime API](/realtime) with [React hooks](/frontend/react-hooks#realtime-hooks) for showing task status in your frontend. You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [self-host](/open-source-self-hosting) on your own infrastructure. +We provide everything you need to build and manage background tasks: a CLI and SDK for writing tasks in your existing codebase, support for both [regular](/tasks/overview) and [scheduled](/tasks/scheduled) tasks, full observability through our dashboard, and a [Realtime API](/realtime) with [React hooks](/frontend/react-hooks#realtime-hooks) for showing task status in your frontend. You can use [Trigger.dev Cloud](https://cloud.trigger.dev) or [self-host](/open-source-self-hosting) on your own infrastructure. ## Learn the concepts diff --git a/docs/machines.mdx b/docs/machines.mdx index 692bd01825..0282e5fb9c 100644 --- a/docs/machines.mdx +++ b/docs/machines.mdx @@ -47,7 +47,11 @@ You can view the Trigger.dev cloud pricing for these machines [here](https://tri You can also override the task machine when you [trigger](/triggering) it: ```ts -await tasks.trigger("heavy-task", { message: "hello world" }, { machine: "large-2x" }); +await tasks.trigger( + "heavy-task", + { message: "hello world" }, + { machine: "large-2x" } +); ``` This is useful when you know that a certain payload will require more memory than the default machine. For example, you know it's a larger file or a customer that has a lot of data. diff --git a/docs/snippets/debugging_in_vscode.mdx b/docs/snippets/debugging_in_vscode.mdx new file mode 100644 index 0000000000..16c1140b2b --- /dev/null +++ b/docs/snippets/debugging_in_vscode.mdx @@ -0,0 +1,21 @@ +Debugging your task code in `dev` is supported via VS Code, without having to pass in any additional flags. Create a launch configuration in `.vscode/launch.json`: + +```json launch.json +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Trigger.dev: Dev", + "type": "node", + "request": "launch", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "npx", + "runtimeArgs": ["trigger.dev@latest", "dev"], + "skipFiles": ["/**"], + "sourceMaps": true + } + ] +} +``` + +Then you can start debugging your tasks code by selecting the `Trigger.dev: Dev` configuration in the debug panel, and set breakpoints in your tasks code. \ No newline at end of file diff --git a/docs/tasks/overview.mdx b/docs/tasks/overview.mdx index 62a7956ebb..4682cdc643 100644 --- a/docs/tasks/overview.mdx +++ b/docs/tasks/overview.mdx @@ -297,6 +297,10 @@ export default defineConfig({ Errors thrown in the `onFailure` function are ignored. + + `onFailure` doesn’t fire for some of the run statuses like `Crashed`, `System failures`, and `Canceled`. + + ### `handleError` functions You can define a function that will be called when an error is thrown in the `run` function, that allows you to control how the error is handled and whether the task should be retried. diff --git a/docs/troubleshooting-debugging-in-vscode.mdx b/docs/troubleshooting-debugging-in-vscode.mdx new file mode 100644 index 0000000000..516e115294 --- /dev/null +++ b/docs/troubleshooting-debugging-in-vscode.mdx @@ -0,0 +1,8 @@ +--- +title: "Debugging in VS Code" +sidebarTitle: "Debugging in VS Code" +--- + +import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx'; + + \ No newline at end of file diff --git a/docs/upgrading-beta.mdx b/docs/upgrading-beta.mdx index 6439190ef1..e5618f1cb5 100644 --- a/docs/upgrading-beta.mdx +++ b/docs/upgrading-beta.mdx @@ -4,6 +4,8 @@ sidebarTitle: "Beta upgrade" description: "How to update to 3.0.0 from the beta" --- +import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx'; + The Trigger.dev packages are now at version `3.0.x` in the `latest` tag. This is our first official release of v3 under the latest tag, and we recommend anyone still using packages in the `beta` tag to upgrade to the latest version. This guide will help you upgrade your project to the latest version of Trigger.dev. The major changes in this release are a new build system, which is more flexible and powerful than the previous build system. We've also made some changes to the `trigger.dev` CLI to improve the developer experience. @@ -374,27 +376,7 @@ The `.env` file works slightly differently in `dev` vs `deploy`: ### dev debugging in VS Code -Debugging your tasks code in `dev` is now supported via VS Code, without having to pass in any additional flags. Create a launch configuration in `.vscode/launch.json`: - -```json launch.json -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Trigger.dev: Dev", - "type": "node", - "request": "launch", - "cwd": "${workspaceFolder}", - "runtimeExecutable": "npx", - "runtimeArgs": ["trigger.dev@latest", "dev"], - "skipFiles": ["/**"], - "sourceMaps": true - } - ] -} -``` - -Then you can start debugging your tasks code by selecting the `Trigger.dev: Dev` configuration in the debug panel, and set breakpoints in your tasks code. + ### TRIGGER_ACCESS_TOKEN in dev