Lazily initialize Supabase browser client

↗ view on GitHub · Navpreet Sidhu · 2026-05-15 · 3ab790a4

Creating the client at module load crashed Next.js prerendering on
Vercel when NEXT_PUBLIC_SUPABASE_URL wasn't inlined yet. A lazy proxy
defers client creation to first use (runtime) without changing the
public `supabase` export API.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Repository NavpreetSSidhu/mike
Author Navpreet Sidhu <navpreet4248@gmail.com>
Authored
Parents df072b0b
Stats 1 file changed , +21 , -5
Part of Vercel monorepo deployment

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-3ab790a4.md from inside the repo you want the change in.

⬇ Download capture-commit-3ab790a4.md