Open
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
I'm getting an error on line
Line 190 in 549fe62
.../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)
)
}
}
}
)
}
The Cookies.parseSSR
bit is in accordance with Quasar SSR instructions.
Screenshots
System information
- OS: Ubuntu 24.04
- Version of @supabase/ssr: 0.5.1
- Version of Node.js: 18.18.2
- Version of Quasar: 2.17.1
- Version of Vue: 3.5.12
Additional context
This error happens both during development with Vite, and in production when running Node.js