TypeError: safeGetSession is not a function (SvelteKit)

Why was
import type { LayoutServerLoad } from "./$types";

export const load: LayoutServerLoad = async ({ locals: { session } }) => {
  return {
    session,
  };
};


changed to

import type { LayoutServerLoad } from './$types'

export const load: LayoutServerLoad = async ({ locals: { safeGetSession }, cookies }) => {
  const { session } = await safeGetSession()
  return {
    session,
    cookies: cookies.getAll(),
  }
}


The safeGetSession seems to not work. I copied it step by step from the supabase docs
Was this page helpful?