I see the following error log in my NextJS server logs a lot and randomly, it blocks me from launching my project, so I need emergency help 🥲
[TypeError: Cannot read properties of undefined (reading 'set')]
It is about createMiddlewareSupabaseClient in @supabase/auth-helpers-nextjs/dist/index.js
setCookie(name, value, options2) {
const newSessionStr = (0, import_auth_helpers_shared.serializeCookie)(name, value, {
...options2,
httpOnly: false
});
context.req.headers.append("cookie", newSessionStr);
context.res.headers.set("set-cookie", newSessionStr);
}
There is also reported open issue:
https://github.com/supabase/auth-helpers/issues/523