-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After upgrading supabase-js Typescript fails with SelectQueryError #568
Comments
Thanks for reporting this! To help us reproduce the issue, could you provide the type definitions for your database used by the client ? If the information is sensitive, you can send it via a Supabase support ticket. With the select query you already included in the issue that should be enough to identify and reproduce the issue. |
We have the same problem with a few of our queries. For example: async function selectUserIdByEmailAddress(emailAddress: string): Promise<string> {
const { data, error } = await supabaseAdmin
.from('user_profile')
.select('user_id')
.eq('email_address', emailAddress)
.single()
if (error) {
throw new Error(error.message)
}
return data.user_id
} (simplified) The error message here is:
Is this part of the Database type enough to help you fix this error? export type Database = {
public: {
Tables: {
user_profile: {
Row: {
created_at: string | null
email_address: string | null
first_name: string | null
language_code: Database["public"]["Enums"]["language_code"]
last_name: string | null
user_id: string
}
Insert: {
created_at?: string | null
email_address?: string | null
first_name?: string | null
language_code?: Database["public"]["Enums"]["language_code"]
last_name?: string | null
user_id: string
}
Update: {
created_at?: string | null
email_address?: string | null
first_name?: string | null
language_code?: Database["public"]["Enums"]["language_code"]
last_name?: string | null
user_id?: string
}
Relationships: []
}
...
}
Views: {
...
}
Functions: {
...
}
Enums: {
language_code: "en" | "de"
...
}
CompositeTypes: {
...
}
}
} |
I am having the same issue with that error since updating. It broke all my site's data fetching/filling. Reverting to the previous version fixed the problem. |
Hey @f0n2, Apologies for the issue. We've reverted the change for now while we gather more debugging data to identify what’s causing the problem on specific projects but not in our tests or on other projects. Thanks for sharing the type subset. Unfortunately, I couldn’t reproduce the issue with it alone. The type inference logic is highly recursive, so the root of the issue might lie elsewhere in your setup. If your project is hosted on Supabase, it would be great if you could open a support ticket: https://supabase.com/dashboard/support/new. Please check the "Allow Supabase Support to access your project temporarily" box. This will allow us to access your database types directly and investigate further. |
@avallete, we created a support ticket. The ID is: 15847753261 |
Bug report
Describe the bug
I have updated the
supabase-js
in my React Native project and suddenly code that worked before with Typescript, now gives an error.To Reproduce
Following code:
Now gives an error with Typescript:
Argument of type 'SelectQueryError<"Invalid Relationships cannot infer result type">' is not assignable to parameter of type 'SetStateAction<UserRowData | null>'.ts(2345)
System information
The text was updated successfully, but these errors were encountered: