© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
11 replies
HunterAndersonX

Client-side data fetching supabaseauth-helpers-nextjs only gets data after navigating internally

I've implemented a client-side request inside useEffect() per the documentation (https://github.com/supabase/auth-helpers/blob/main/packages/nextjs/README.md#client-side-data-fetching-with-rls), and it works great when navigating inside the app, but if I load the page directly, it fails to return any data. There's no error though, it just returns an empty array. I've checked that the user object is present, but somehow, it still always returns an empty set instead of the expected set of objects.

Page code: https://gist.github.com/8d250b94057981f7f17cc0dc73abc274

Versions:
{
  "dependencies": {
    "@supabase/auth-helpers-nextjs": "^0.2.8",
    "@supabase/auth-helpers-react": "^0.2.4",
    "@supabase/supabase-js": "^1.35.7",
    "@supabase/ui": "^0.36.5",
    "next": "12.3.1",
    "pocketbase": "^0.7.1",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
}
{
  "dependencies": {
    "@supabase/auth-helpers-nextjs": "^0.2.8",
    "@supabase/auth-helpers-react": "^0.2.4",
    "@supabase/supabase-js": "^1.35.7",
    "@supabase/ui": "^0.36.5",
    "next": "12.3.1",
    "pocketbase": "^0.7.1",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
}
Gist
Data only loads after internal navigation
Data only loads after internal navigation. GitHub Gist: instantly share code, notes, and snippets.
Data only loads after internal navigation
GitHub
auth-helpers/README.md at main · supabase/auth-helpers
A collection of framework specific Auth utilities for working with Supabase. - auth-helpers/README.md at main · supabase/auth-helpers
auth-helpers/README.md at main · supabase/auth-helpers
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Queries work navigating internally but not when loading page directly (supabaseauth-helpers-nextjs)
SupabaseSSupabase / help-and-questions
4y ago
NextJS: User data client side?
SupabaseSSupabase / help-and-questions
2y ago
'supabaseauth-helpers-nextjs' gives SyntaxError Unexpected token 'export'
SupabaseSSupabase / help-and-questions
4y ago
supabaseauth-helpers-nextjs has no exported member named createMiddlewareSupabaseClient
SupabaseSSupabase / help-and-questions
4y ago