docs: added runtime error note for supabase edge function (#3140)

This commit is contained in:
Iss
2026-02-27 10:59:04 -05:00
committed by GitHub
parent 8003923598
commit 24b92d3b68
@@ -192,4 +192,24 @@ Check your [cloud.trigger.dev](http://cloud.trigger.dev) dashboard and you shoul
</Step>
</Steps>
### If you see a runtime error when calling tasks.trigger()
If you see `TypeError: Cannot read properties of undefined (reading 'toString')` when calling `tasks.trigger()` from your edge function, the SDK is hitting a dependency that expects Node-style APIs not available in the Supabase Edge (Deno) runtime. Use the [Tasks API](/management/tasks/trigger) with `fetch` instead of the SDK—that avoids loading the SDK in Deno:
```ts
const response = await fetch(
`https://api.trigger.dev/api/v1/tasks/your-task-id/trigger`,
{
method: "POST",
headers: {
Authorization: `Bearer ${Deno.env.get("TRIGGER_SECRET_KEY")}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ payload: { your: "payload" } }),
}
);
```
See [Trigger task via API](/management/tasks/trigger) for full request/response details and optional fields (e.g. `delay`, `idempotencyKey`).
<SupabaseDocsCards />