supabase / postgrest-js

Isomorphic JavaScript client for PostgREST.
https://supabase.com
MIT License
962 stars 128 forks source link

PostgresClient is not a constructor #538

Closed RamyaChinnadurai closed 1 month ago

RamyaChinnadurai commented 1 month ago

Starting this morning, I began encountering the error PostgresClient is not a constructor despite not making any changes to my code.

I'm currently using @supabase/supabase-js: 2.12.0.

I suspected that the issue might be related to a recent update in one of the dependencies. Turns out supabase/postgres-js updated in the last 24 hours

As a temporary workaround, I have forced the use of a previous version of the dependency by adding the following to my package.json:

resolutions: {
 "@supabase/postgrest-js": "1.1.1",
}

Looking for a permanent solution for this case

Supercoderboi commented 1 month ago

Same issue here TypeError: ue.PostgrestClient is not a constructor at new j (SupabaseClient.ts:106:17) at Oe (index.ts:42:10) at main.js:5:18

darrendawson commented 1 month ago

I also ran into this today when deploying a new edge function. The deploy was successful, but calling the EF always results in an error code 546 and the message:

event loop error: TypeError: ue.PostgrestClient is not a constructor
    at new j (https://esm.sh/v135/@supabase/supabase-js@2.43.3/deno/supabase-js.mjs:12:5741)
    at Oe (https://esm.sh/v135/@supabase/supabase-js@2.43.3/deno/supabase-js.mjs:12:9156)
zguo123 commented 1 month ago

Same issue here. I solved by downgrading to the previous version.

constant-work commented 1 month ago

Started receiving this error today as well:

ue.PostgrestClient is not a constructor

Was importing as:

import { createClient } from 'https://esm.sh/@supabase/supabase-js';

Now working by rolling back to:

import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.43.2';

kevinschaich commented 1 month ago

similar error, I had the following:

import { PostgrestError } from '@supabase/supabase-js'

was working fine, didn't make any changes, now I get:

Type error: Could not find a declaration file for module '@supabase/supabase-js'.
KTayy commented 1 month ago

Hi all, I had the same issue, I just used a diff version in my import statement and it worked out. in my case it was import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.43.1'

did not change anything else