You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an edge function fails due to a platform 404 error, it will return the error:
{
"code": "NOT_FOUND",
"message": "Requested function was not found"
}
Inspecting the logs
You cannot inspect the function dashboard to find platform 404 errors, instead, run the below query in the log explorer. The results show all requests that reached Supabase but were rejected as unrecognizable.
select distinctreq.pathnameas function_name,
res.status_code,
case
when metadata.execution_id is null then 'FUNCTION_NOT_FOUND'
else 'FUNCTION RECOGNIZED: custom 404 message in app logic'
end as type_of_404
from
function_edge_logs
cross join UNNEST(metadata) as metadata
cross join UNNEST(metadata.request) as req
cross join UNNEST(metadata.response) as res
where status_code =404limit10;
Step 2: Check the function for typos
In your code, make sure your function name doesn't have any typos, such as:
miscapitalization
em-dashes instead of dashes
misplaced characters
unnecessary slashes ///
Step 3: Try calling the function from the dashboard
When selecting your function in the Function Dashboard, you should have the option to make a test call:
If the call works, consider double checking your code for typos or to see if it is overwriting the function name dynamically. Otherwise, go on to step 4.
Step 4: Redeploy the function
If step 3 fails, it may be a sign of an internal bug and it may be necessary to redeploy your function. This can be done within the Function Dashboard under the respective function's code tab:
Alternatively, if you develop locally, you can redeploy the function with the Supabase CLI:
supabase functions deploy FUNCTION_NAME
# If you want to deploy all functions, run the `deploy` command without specifying a function name:
supabase functions deploy
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a copy of a troubleshooting article on Supabase's docs site. It may be missing some details from the original. View the original article.
The edge function is not recognized by Supabase
Context for the error
If the Supabase Edge Function Runtime does not recognize the function specified in the URL endpoint:
then the runtime will return a 404 error.
Solving the error
Step 1: Identifying the error
Inspecting the return message from the request
When an edge function fails due to a platform 404 error, it will return the error:
{ "code": "NOT_FOUND", "message": "Requested function was not found" }Inspecting the logs
You cannot inspect the function dashboard to find platform 404 errors, instead, run the below query in the log explorer. The results show all requests that reached Supabase but were rejected as unrecognizable.
Step 2: Check the function for typos
In your code, make sure your function name doesn't have any typos, such as:
///Step 3: Try calling the function from the dashboard
When selecting your function in the Function Dashboard, you should have the option to make a test call:
If the call works, consider double checking your code for typos or to see if it is overwriting the function name dynamically. Otherwise, go on to step 4.
Step 4: Redeploy the function
If step 3 fails, it may be a sign of an internal bug and it may be necessary to redeploy your function. This can be done within the Function Dashboard under the respective function's code tab:
Alternatively, if you develop locally, you can redeploy the function with the Supabase CLI:
supabase functions deploy FUNCTION_NAME # If you want to deploy all functions, run the `deploy` command without specifying a function name: supabase functions deployThen write in a ticket to Supabase Support
Additional resources
Beta Was this translation helpful? Give feedback.
All reactions