Bug report
Describe the bug
After updating supabase from 2.67 to 2.72 the createClient function in edge functions (documented here) fails locally. Still works in production though.
By failing here is the console error message: TypeError: Key for the ES256 algorithm must be of type CryptoKey. Received an instance of Uint8Array.
To reproduce
- Start a local docker version of supabase 2.72 or later
- Try creating a supabase client like so:
export const supabaseAdmin = createClient(
Deno.env.get("SUPABASE_URL") || "",
Deno.env.get("SUPABASE_SERVICE_ROLE_KEY") || ""
)
const getSupabaseUserClient = (request: Request) =>
createClient(
Deno.env.get("SUPABASE_URL") || "",
Deno.env.get("SUPABASE_ANON_KEY") || "",
// Create client with Auth context of the user that called the function.
{
global: {
headers: { Authorization: request.headers.get("Authorization") },
},
}
)
Deno.serve(async (request: Request) => {
getSupabaseUserClient(request)
supabaseAdmin()
})
- run the function and you should have the error
My guess is that the default provided environment variables like SUPABASE_SERVICE_ROLE_KEY or SUPABASE_ANON_KEY have been updated but are now not compatible with supabase-js.
I've also seen a new documentation here but it does not seem to talk about impersonated clients.
Might be related to supabase/supabase#42037
Bug report
Describe the bug
After updating supabase from
2.67to2.72the createClient function in edge functions (documented here) fails locally. Still works in production though.By failing here is the console error message:
TypeError: Key for the ES256 algorithm must be of type CryptoKey. Received an instance of Uint8Array.To reproduce
My guess is that the default provided environment variables like
SUPABASE_SERVICE_ROLE_KEYorSUPABASE_ANON_KEYhave been updated but are now not compatible withsupabase-js.I've also seen a new documentation here but it does not seem to talk about impersonated clients.
Might be related to supabase/supabase#42037