Edge Function 503 error response
Last edited: 8/21/2026
A 503 HTTP status code from an Edge Function indicates one of three possible events:
- the function failed to boot due to
SyntaxError - your own code returned a 503
- the platform itself is having issues
These require different fixes, so it is useful to decipher the cause before debugging:
Step 1: Figure out which 503 you have#
If you received back a BOOT_ERROR message, like the one below, you can jump to the resolution section: Boot Error
1{2 "code": "BOOT_ERROR",3 "message": "Function failed to start (please check logs)"4}Otherwise, run the below query in the SQL Editor.
1select2 log_attributes['request.pathname'] as function_name,3 log_attributes['response.status_code'] as status_code,4 case5 when log_attributes['execution_id'] != ''6 and log_attributes['function_id'] != '' then 'app_level'7 when log_attributes['execution_id'] = ''8 and log_attributes['function_id'] != '' then 'boot_error'9 when log_attributes['execution_id'] = ''10 and log_attributes['function_id'] = '' then 'internal_failure'11 end as error_type12from logs13where14 source = 'function_edge_logs'15 and toInt32OrZero(log_attributes['response.status_code']) = 50316limit 50;Depending on the output, you can use this table to find the appropriate debugging section:
| Value | Go to |
|---|---|
app_level | app level error |
boot_error | boot error - function cannot compile |
internal_failure | platform issue |
Step 2: Addressing the error#
App level error#
Somewhere in your function logic, you are returning a 503 response yourself:
Example:#
1return new Response(JSON.stringify(data), {2 headers: { ...corsHeaders, 'Content-Type': 'application/json' },3 status: 503, // <-- you set this4})Check your function logic and any third-party API responses for where the 503 is originating.
- Search your function code for
503. Look for explicit status codes onResponseobjects - Trace the condition that triggered it. If your function calls external APIs, it may be passing along errors returned by those services
- Add logging before the return so future occurrences leave a trace:
1console.error('Returning 503 - reason:', reason)See: Error handling in Edge Functions
Boot error#
A SyntaxError prevented your code from dynamically compiling.
In the Function Dashboard, under the affected function's Log tab, you can filter for the key phrase worker boot error:. the log will tell you syntax error occurred:

Alternatively, instead of using the Function Dashboard, you can programmatically find boot failure error messages in the SQL Editor with the below query:
1select2 fl.event_message,3 fl.timestamp,4 fel.function_name,5 fel.status_code6from7 (8 select9 timestamp,10 event_message,11 log_attributes['function_id'] as function_id,12 log_attributes['version'] as version13 from logs14 where source = 'function_logs'15 and log_attributes['event_type'] = 'BootFailure'16 ) as fl17 left join (18 select19 log_attributes['function_id'] as function_id,20 log_attributes['version'] as version,21 log_attributes['request.pathname'] as function_name,22 log_attributes['response.status_code'] as status_code23 from logs24 where source = 'function_edge_logs'25 ) as fel on fl.function_id = fel.function_id and fl.version = fel.version26order by fl.timestamp, fel.function_name27limit 20;Example causes#
Redefining constant variables#
Redefining a constant value can prevent the code from compiling:
1let some_var2const some_var // SyntaxError — already declaredThe log message for these errors should state the cause already declared and the file impacted.
1worker boot error: Uncaught SyntaxError:2Identifier 'some_var' has already been declared at file:///var/tmp/sb-compile-edge-runtime/source/index.ts:6:7Key word violations#
Some key words can only be used in specific contexts. For instance, the await key word can only be used inside async functions.
1(req: Request) => {2 const { name } = await req.json(); // await only works inside async functions3}The log message for these errors should state the cause Unexpected reserved word and the file impacted.
1worker boot error: Uncaught SyntaxError:2Unexpected reserved word at file:///var/tmp/sb-compile-edge-runtime/source/index.ts:6:28Bad imports: Non-existent modules or named exports#
Imports can cause errors if they're not available within the edge function:
1// importing non-existent module2import supabase from 'does_not_exist'3// or accessing non-existent export4import { doesNotExist } from 'jsr:@supabase/functions-js'56doesNotExist()The log message for these errors should state the cause requested module... does not provide an export and the file impacted.
1worker boot error: Uncaught SyntaxError:2The requested module 'jsr:@supabase/functions-js' does not provide an export named 'doesNotExist' at file:///var/tmp/sb-compile-edge-runtime/source/index.ts:2:10”To fix, check the module and its imports to make sure they exist and are supported by Supabase Edge Functions.
If the module worked before, check to see if the most recent release had breaking changes and then only import the working version.
Platform issue#
The edge function runtime is overwhelmed, or the API Gateway is returning its own 503 due to excessive load.
Open a support ticket and include the relevant log output from Step 1.
Additional resources#
- Logging Edge Function Requests
- Error Handling Edge Functions
- Local Debugging with Chrome Dev Tools
- Quickstart Deployment: Dashboard
- Quickstart Deployment: CLI
Still stuck?#
- Check the Discord, Supabase GitHub Discussions, and Reddit page for similar reports that can help with debugging
- Open a support ticket for your project if the problem persists and you believe it is a platform issue