From 24b92d3b687e342506bede1237ea39ad1c623e13 Mon Sep 17 00:00:00 2001 From: Iss <74388823+isshaddad@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:59:04 -0500 Subject: [PATCH] docs: added runtime error note for supabase edge function (#3140) --- .../supabase-edge-functions-basic.mdx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/guides/frameworks/supabase-edge-functions-basic.mdx b/docs/guides/frameworks/supabase-edge-functions-basic.mdx index 260874016..c3372c41e 100644 --- a/docs/guides/frameworks/supabase-edge-functions-basic.mdx +++ b/docs/guides/frameworks/supabase-edge-functions-basic.mdx @@ -192,4 +192,24 @@ Check your [cloud.trigger.dev](http://cloud.trigger.dev) dashboard and you shoul +### 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`). +