When using @livekit/components-react inside a Next.js (App Router) project, the app throws a runtime error related to localStorage access:
Runtime SecurityError
Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
This occurs inside:
components/livekit/agent-control-bar/hooks/use-agent-control-bar.ts (78:31)
Screenshot
Environment
- Next.js: 15.5.9 (Turbopack)
- React: 19
Is this a known issue with @livekit/components-react in Next.js App Router?
Is there a recommended pattern for using AgentControlBar in SSR environments?
When using @livekit/components-react inside a Next.js (App Router) project, the app throws a runtime error related to localStorage access:
Runtime SecurityError
Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
This occurs inside:
components/livekit/agent-control-bar/hooks/use-agent-control-bar.ts (78:31)
Screenshot
Environment
Is this a known issue with @livekit/components-react in Next.js App Router?
Is there a recommended pattern for using AgentControlBar in SSR environments?