© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3mo ago•
3 replies
barlazy

getSession hangs [javascript client library]

Issue Summary for Supabase
Title: getSession() and refreshSession() hang indefinitely even with lock: noOpLock workaround
Environment:
@supabase/supabase-js (check your version in package.json)
Browser: Chrome (likely others too)
Next.js app
Problem:
After a JWT token refresh occurs, subsequent calls to supabase.auth.getSession() and supabase.auth.refreshSession() hang indefinitely and never resolve.
Symptoms:
onAuthStateChange fires TOKEN_REFRESHED successfully
Immediately after, any call to getSession() or refreshSession() hangs forever
Applied the lock: noOpLock workaround from #1594 - did not help
App becomes unusable - all authenticated API requests fail
Reproduction:
User is logged in, JWT expires (5 min expiry for testing)
Auto-refresh triggers, TOKEN_REFRESHED event fires
User clicks a button that triggers an API request
Request interceptor calls getSession() to get current token
getSession() never resolves (hangs)
Expected: getSession() should return immediately with the session from localStorage/memory.
Actual: getSession() hangs indefinitely, even with Web Locks disabled via lock: noOpLock.
Workaround needed: Reading token directly from localStorage (sb-{project}-auth-token) bypasses the issue, but this shouldn't be necessary.
Reference: Related to #1594 but the noOpLock workaround doesn't fully resolve it.
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

getSession in “use client”
SupabaseSSupabase / help-and-questions
3y ago
Golang client library PRs
SupabaseSSupabase / help-and-questions
3mo ago
Client Library JOIN Queries
SupabaseSSupabase / help-and-questions
14mo ago
await client.auth.signOut() hangs and has no error
SupabaseSSupabase / help-and-questions
7mo ago