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

Version v2.39.2 and above break types #974

Closed sg3510 closed 3 months ago

sg3510 commented 3 months ago

Likely because of bumping postgrest-js with v2.39.2 but when using strict in tsconfig and any code like this:

const { error } = await supabase
      .from('Messages')
      .update({ deletedAt: moment().toISOString()})

gives me Argument of type '{ deletedAt: string; }' is not assignable to parameter of type 'never'.

I have confirmed I have the latest generated types.

Bug report

-->

Describe the bug

See above

To Reproduce

Upgrade to v2.39.2 or above

Expected behavior

TS linter shouldn't complain

System information

Additional context

Add any other context about the problem here.

pierre-charpentier commented 3 months ago

Faced this issue in version v2.39.4 but not in v2.39.3.

With git bisect, I tracked down the issue to this commit : https://github.com/supabase/supabase-js/commit/a5a70dbe21a2e0ec6d8ec117caa35c605f69eb41

It seems some types are not infered properly anymore.

heloineto commented 3 months ago

Having the same issue

Gbuomprisco commented 3 months ago

Faced this issue in version v2.39.4 but not in v2.39.3.

With git bisect, I tracked down the issue to this commit : a5a70db

It seems some types are not infered properly anymore.

Same here - I reverted to 2.39.3 and all good.

kstolk commented 4 weeks ago

Still an issue, any updates?