You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Persona crashing in Vite dev mode by deferring WebGL2 context creation to avoid exhausting browser context limits during React Strict Mode's double-mount cycle.
Copy file name to clipboardExpand all lines: apps/docs/content/components/(voice)/persona.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,14 @@ The Persona component responds to five distinct states, each triggering differen
118
118
-**speaking**: Active when the AI is delivering a response (e.g., text-to-speech output)
119
119
-**asleep**: A dormant state for when the AI is inactive or in low-power mode
120
120
121
+
## React Strict Mode (Vite)
122
+
123
+
The Persona component uses WebGL2 for rendering. Browsers limit the number of active WebGL2 contexts (~8–16), and React Strict Mode (enabled by default in Vite dev) double-mounts components, which can exhaust that limit and crash the page.
124
+
125
+
The component includes a built-in guard that defers WebGL2 initialization by one frame, preventing context creation during Strict Mode's throw-away mount. This means the component works in Vite dev mode out of the box — no configuration needed.
126
+
127
+
If you still experience crashes (for example, when rendering many Persona instances simultaneously), reduce the number of concurrent Persona components on screen.
0 commit comments