.../node_modules/@supabase/ssr/dist/main/cookies.js:238
cookie = allCookies?.find(({ name }) => name === chunkName) || null;
^
TypeError: allCookies?.find is not a function
IMPORTANT: The error is solved if adding an additional optional chaining operator to the supabase source, as in allCookies?.find?.(. Not sure if there's any underlying issue, though.
To Reproduce
This is how I'm creating the client:
import { Cookies } from 'quasar';
import { QSsrContext } from '@quasar/app-vite';
import { createServerClient, type CookieOptions } from '@supabase/ssr';
function initSupabaseServer(ssrContext: QSsrContext) {
const cookies = Cookies.parseSSR(ssrContext)
return createServerClient(
process.env.VITE_SUPABASE_URL!,
process.env.VITE_SUPABASE_ANON_KEY!,
{
cookies: {
getAll: () => cookies?.getAll(),
setAll: (cookiesToSet: {
name: string
value: string
options: CookieOptions
}[]) => {
cookiesToSet.forEach(({ name, value, options }) =>
cookies.set(name ,value, options)
)
}
}
}
)
}
Bug report
Describe the bug
I'm getting an error on line https://github.com/supabase/ssr/blob/549fe62813fb9c7277f7eda9e46ee0420f8e0b5f/src/cookies.ts#L190 when creating a Supabase server client on the Quasar Framework:
IMPORTANT: The error is solved if adding an additional optional chaining operator to the supabase source, as in
allCookies?.find?.(
. Not sure if there's any underlying issue, though.To Reproduce
This is how I'm creating the client:
The
Cookies.parseSSR
bit is in accordance with Quasar SSR instructions.Screenshots
System information
Additional context
This error happens both during development with Vite, and in production when running Node.js