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
I set up the client like how multiple examples showed, and it worked and was able to getUser, and then suddenly it doesn't anymore and gives me this error:
[Info] AuthRetryableFetchError: error sending request for url (http://127.0.0.1:54321/auth/v1/user)
at _handleRequest (file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/lib/fetch.js:111:15)
at eventLoopTick (ext:core/01_core.js:168:7)
at async _request (file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/lib/fetch.js:95:18)
at async file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/GoTrueClient.js:882:24
at async SupabaseAuthClient._useSession (file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/GoTrueClient.js:782:20)
at async SupabaseAuthClient._getUser (file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/GoTrueClient.js:872:20)
at async file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/GoTrueClient.js:859:20
at async file:///tmp/sb-compile-edge-runtime/node_modules/localhost/@supabase/auth-js/2.65.0/dist/main/GoTrueClient.js:727:28 {
__isAuthError: true,
name: "AuthRetryableFetchError",
status: 0,
code: undefined
}
And this is the edge function code:
import"jsr:@supabase/functions-js/edge-runtime.d.ts";import{corsHeaders}from"../_shared/cors.ts";import{createClient}from"jsr:@supabase/supabase-js@2";Deno.serve(async(req)=>{if(req.method==="OPTIONS"){returnnewResponse("ok",{headers: corsHeaders});}try{constsupabase=createClient(// Supabase API URL - env var exported by default.Deno.env.get("API_URL")??"",// Supabase API ANON KEY - env var exported by default.Deno.env.get("ANON_KEY")??"",// Create client with Auth context of the user that called the function.// This way your row-level-security (RLS) policies are applied.{global: {headers: {Authorization: req.headers.get("Authorization")!},},},);const{ data, error }=awaitsupabase.auth.getUser();console.log(error);if(error){// console.log("Error fetching user:", error.message);thrownewError(error.message);}returnnewResponse(JSON.stringify(data),{headers: { ...corsHeaders,"Content-Type": "application/json"},status: 200,});}catch(error){returnnewResponse(JSON.stringify({error: error.message}),{headers: { ...corsHeaders,"Content-Type": "application/json"},status: 400,});}});
I am not sure what is causing this, it's driving me up the wall.
This is running locally.
supabase-edge-runtime-1.58.3 (compatible with Deno v1.45.2)
supabase v.1.200.3
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
-
I set up the client like how multiple examples showed, and it worked and was able to getUser, and then suddenly it doesn't anymore and gives me this error:
And this is the edge function code:
I am not sure what is causing this, it's driving me up the wall.
This is running locally.
supabase-edge-runtime-1.58.3 (compatible with Deno v1.45.2)
supabase v.1.200.3
Beta Was this translation helpful? Give feedback.
All reactions