supabase-js
supabase-js copied to clipboard
fix(auth): handle uncaught promise rejections during initialization
Problem
initialize() is called in the constructor without a .catch() handler.
When using async storage adapters (e.g., Chrome extensions), lock acquisition timeouts or storage errors cause unhandled promise rejections that crash the application.
Solution
Add .catch() handlers to initialize(), broadcast channel message handler, and visibility change callback.
Errors are logged via _debug() and remain retrievable via await client.initialize().
Related
- Closes #2030