Fix viewer crash in unsupported GPU contexts
Summary\n- detect browsers/environments with neither WebGPU nor WebGL before mounting the R3F Canvas\n- render a small unsupported 3D viewer fallback instead of initializing Three's WebGPU renderer\n- switch to the same fallback when renderer init still rejects, avoiding repeated failed mounts\n\n## Validation\n- bun run --filter @pascal-app/viewer build\n- bunx biome lint packages/viewer/src/components/viewer/index.tsx\n\nFixes Sentry MONOREPO-EDITOR-59.
Preview deployment for your docs. Learn more about Mintlify Previews.
| Project | Status | Preview | Updated (UTC) |
|---|---|---|---|
| pascal | 🔴 Failed | – | Jun 14, 2026, 4:08 AM |
💡 Tip: Enable Workflows to automatically generate PRs for you.
Nightly Sentry triage (06-16): EDITOR-59 (getSupportedExtensions of null in three.webgpu WebGLBackend.init) still unresolved, last seen 06-16 02:21 on HeadlessChrome/no-GPU clients. Related family: EDITOR-3P Cannot read properties of null (reading 'addEventListener') in @react-three/fiber events connect (last seen 06-16 01:35, Windows prod) — same root cause (missing/torn-down GL context / canvas). Please confirm this PR's guard also covers the R3F connect() null-domElement path, or it may need a companion guard.
Nightly Sentry triage 2026-06-17: EDITOR-59 (getSupportedExtensions on null GL context) is still recurring — latest event 2026-06-17T03:01Z on Mobile Safari iOS 18.7 at editor.pascal.app. Sibling issue EDITOR-AY ("Error creating WebGL context") is the same root cause (null/failed context on device). This PR's unsupported-GPU-context guard should resolve both; bumping for review. No duplicate PR opened.
Nightly Sentry triage 2026-06-18: EDITOR-59 (Cannot read properties of null (reading 'getSupportedExtensions') in three.webgpu WebGLBackend.init) still recurring — latest event 2026-06-18T03:37Z on Chrome Mobile WebView 57 (ancient in-app browser, no WebGL2/WebGPU). This PR's unsupported-GPU guard still looks like the right fix; please review/land when you can. Also seeing the sibling EDITOR-79 (isShaderMaterial on undefined) on the same old-WebView class of devices — the same context-null guard may cover it.