From 747278d2892b20678106700274dc09f9380b3940 Mon Sep 17 00:00:00 2001 From: isshaddad Date: Thu, 26 Feb 2026 15:57:34 -0500 Subject: [PATCH] added runtime error note for supabase edge function --- .../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 26087401607..c3372c41e94 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`). +