Skip to content

Commit e19bf2a

Browse files
authored
Docs/more docs improvements (#1718)
* Format the machine override example code * Adds note to add `fluent-ffmpeg` to external * Updates onFailure with more clarification * Adds debugging in vs code to Troubleshooting * Removed link
1 parent 23b4c2a commit e19bf2a

10 files changed

+49
-23
lines changed

docs/config/config-file.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,8 @@ export default defineConfig({
659659

660660
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`.
661661

662+
Note that `fluent-ffmpeg` needs to be added to [`external`](/config/config-file#external) in your `trigger.config.ts` file.
663+
662664
Follow [this example](/guides/examples/ffmpeg-video-processing) to get setup with Trigger.dev and FFmpeg in your project.
663665

664666
#### esbuild plugins

docs/docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@
183183
"group": "Troubleshooting",
184184
"pages": [
185185
"troubleshooting",
186+
"troubleshooting-debugging-in-vscode",
186187
"upgrading-packages",
187188
"upgrading-beta",
188189
"troubleshooting-alerts",

docs/guides/examples/ffmpeg-video-processing.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export default defineConfig({
3636

3737
You'll also need to add `@trigger.dev/build` to your `package.json` file under `devDependencies` if you don't already have it there.
3838

39+
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.
40+
3941
## Compress a video using FFmpeg
4042

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

docs/guides/frameworks/supabase-edge-functions-database-webhooks.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ export default defineConfig({
270270
if you don't already have it there.
271271
</Note>
272272

273+
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.
274+
273275
### Add your Deepgram and Supabase environment variables to your Trigger.dev project
274276

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

docs/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mode: "center"
2424

2525
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.
2626

27-
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.
27+
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.
2828

2929
## Learn the concepts
3030

docs/machines.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ You can view the Trigger.dev cloud pricing for these machines [here](https://tri
4747
You can also override the task machine when you [trigger](/triggering) it:
4848

4949
```ts
50-
await tasks.trigger<typeof heavyTask>("heavy-task", { message: "hello world" }, { machine: "large-2x" });
50+
await tasks.trigger<typeof heavyTask>(
51+
"heavy-task",
52+
{ message: "hello world" },
53+
{ machine: "large-2x" }
54+
);
5155
```
5256

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

docs/snippets/debugging_in_vscode.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
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`:
2+
3+
```json launch.json
4+
{
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Trigger.dev: Dev",
9+
"type": "node",
10+
"request": "launch",
11+
"cwd": "${workspaceFolder}",
12+
"runtimeExecutable": "npx",
13+
"runtimeArgs": ["trigger.dev@latest", "dev"],
14+
"skipFiles": ["<node_internals>/**"],
15+
"sourceMaps": true
16+
}
17+
]
18+
}
19+
```
20+
21+
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.

docs/tasks/overview.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ export default defineConfig({
297297

298298
<Info>Errors thrown in the `onFailure` function are ignored.</Info>
299299

300+
<Note>
301+
`onFailure` doesn’t fire for some of the run statuses like `Crashed`, `System failures`, and `Canceled`.
302+
</Note>
303+
300304
### `handleError` functions
301305

302306
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.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: "Debugging in VS Code"
3+
sidebarTitle: "Debugging in VS Code"
4+
---
5+
6+
import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx';
7+
8+
<DebuggingInVSCode />

docs/upgrading-beta.mdx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ sidebarTitle: "Beta upgrade"
44
description: "How to update to 3.0.0 from the beta"
55
---
66

7+
import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx';
8+
79
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.
810

911
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`:
374376

375377
### dev debugging in VS Code
376378

377-
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`:
378-
379-
```json launch.json
380-
{
381-
"version": "0.2.0",
382-
"configurations": [
383-
{
384-
"name": "Trigger.dev: Dev",
385-
"type": "node",
386-
"request": "launch",
387-
"cwd": "${workspaceFolder}",
388-
"runtimeExecutable": "npx",
389-
"runtimeArgs": ["trigger.dev@latest", "dev"],
390-
"skipFiles": ["<node_internals>/**"],
391-
"sourceMaps": true
392-
}
393-
]
394-
}
395-
```
396-
397-
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.
379+
<DebuggingInVSCode />
398380

399381
### TRIGGER_ACCESS_TOKEN in dev
400382

0 commit comments

Comments
 (0)