Next.js Supabase example fails with local Supabase instance (middleware returns null)

The supabase's nextjs example works if I connect a supabase's hosted project, but when I try o connect with my local development env, the middleware (now it's called proxy with the new version of nextjs) returns null at line 47 (the file is lib/supabase/middleware.ts)

To Reproduce

  1. pnpm create next-app@latest -e with-supabase
  2. npx @next/codemod@canary middleware-to-proxy .
  3. pnpm approve-builds
  4. pnpm add -D supabase
  5. pnpm supabase init
  6. pnpm supabase start
  7. Put the supabase url and publishable key inside .env.local
  8. Create an account at supabase local dashboard
    Try to login and access /protected route
Was this page helpful?