Remix LoaderFunctionArgs request parameter is incompatible with types from supabase/ssr createServerClient
searchableguy opened this issue · comments
searchableguy commented
Code example
import { redirect } from "@remix-run/node";
import { createServerClient } from "@supabase/ssr";
import type { LoaderFunctionArgs } from "@remix-run/node";
export const loader = async ({ request }: LoaderFunctionArgs) => {
const supabaseClient = createServerClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_ANON_KEY!,
{ request, response }
);
}
Error
Object literal may only specify known properties, and 'request' does not exist in type 'SupabaseClientOptions<"public"> & { cookies: CookieMethods; cookieOptions?: CookieOptionsWithName | undefined; }'.
This mismatch doesn't happen with the older auth-remix-helper
package so seems to be a breaking change.
Package.json
"@remix-run/css-bundle": "^2.5.1",
"@remix-run/node": "^2.5.1",
"@remix-run/react": "^2.5.1",
"@remix-run/serve": "^2.5.1",
"@supabase/auth-helpers-remix": "^0.2.6",
"@supabase/ssr": "^0.0.10",
"@supabase/supabase-js": "^2.39.3",
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Edit: The migration guide explains the new changes here: https://supabase.com/docs/guides/auth/server-side/creating-a-client?framework=remix