supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.86k stars 220 forks source link

Deno edge function encounters unexpected bug with supabase-js client in local deployment #900

Open JungeWerther opened 6 months ago

JungeWerther commented 6 months ago

Bug report

Description

I'm able to deploy a deno edge function locally and run a test without problems using supabase functions serve --env-file ./supabase/functions/.env.local. The supabase-js client library loads fine when I run deno test --allow-all ./tests/jl-call-test.ts --env=./functions/.env.local. However, the functions server shuts down with the following error:

Segmentation fault (core dumped)
error running container: exit 139

which happens at

const client = createClient(
      supabaseUrl, 
      supabaseKey, {
        auth: {
          autoRefreshToken: false,
          persistSession: false,
          detectSessionInUrl: false,
        },
        db: {
          schema: 'custom_schema_name'
        }
      })

As I said the above snippet runs perfectly well in my unit test. Running with the --debug flag outputs no extra information.

Weirdly, if I remove the supabase-js client logic, my function is responsive in local development and works as expected. Any idea what might be going on here? Thanks 🫶

System information

teleskop150750 commented 6 months ago

supabase cli

the same error occurs during local development

image

works in 1.108.3

image

psemsari commented 6 months ago

Same here

Screenshot 2023-11-10 at 18 08 01

maybe on mac i don't know

therealpurplemana commented 3 weeks ago

I'm seeing exact same segfaulting on local deno edge functions on a Macbook M3 Pro