Made it clearer that tasks need to be exported
This commit is contained in:
@@ -13,7 +13,7 @@ Here's an incredibly simple task:
|
||||
```ts /trigger/hello-world.ts
|
||||
import { task } from "@trigger.dev/sdk/v3";
|
||||
|
||||
//1. You need to export each task
|
||||
//1. You need to export each task, even if it's a subtask
|
||||
export const helloWorld = task({
|
||||
//2. Use a unique id for each task
|
||||
id: "hello-world",
|
||||
@@ -25,6 +25,10 @@ export const helloWorld = task({
|
||||
});
|
||||
```
|
||||
|
||||
<Note>
|
||||
You must `export` each task, even subtasks inside the same file. When exported they are accessible so their configuration can be registered with the platform.
|
||||
</Note>
|
||||
|
||||
You can trigger this in two ways:
|
||||
|
||||
1. From the dashboard [using the "Test" feature](/run-tests).
|
||||
|
||||
Reference in New Issue
Block a user