Fix viewer crash in unsupported GPU contexts#403
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Nightly Sentry triage (06-16): EDITOR-59 ( |
|
Nightly Sentry triage 2026-06-17: EDITOR-59 ( |
|
Nightly Sentry triage 2026-06-18: EDITOR-59 ( |
Adds a capability check and an UnsupportedGpuViewerFallback so the viewer renders an informative panel instead of crashing on environments that expose neither WebGPU nor WebGL. Capability detection runs post-mount to stay hydration-safe, the renderer-init failure path swaps to the fallback, and the fallback signals scene-readiness so the host editor loader does not hang. Reworked from #403 (anton-pascal) onto current main; resolves the import conflict and the SSR/scene-ready gotchas surfaced in review. Co-authored-by: anton-pascal <anton@pascal.app>
61cba2c to
74fed4b
Compare
|
Reworked onto current
Typecheck + viewer tests pass. Verifying CI before merge. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 74fed4b. Configure here.
| // readiness explicitly so the host can drop its loader immediately. | ||
| useEffect(() => { | ||
| if (showGpuFallback) onSceneReadyChange?.(true) | ||
| }, [showGpuFallback, onSceneReadyChange]) |
There was a problem hiding this comment.
Fallback omits scene reload signal
Medium Severity
The GPU fallback's useEffect signals scene readiness only on initial dependency changes. When the editor loads a new scene, it resets readiness, but the fallback's useEffect won't re-trigger to signal readiness again. This happens because the SceneReadyTracker isn't mounted in the fallback path, causing the editor to wait for its eight-second timeout.
Reviewed by Cursor Bugbot for commit 74fed4b. Configure here.


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.
Note
Low Risk
Localized viewer mount/error-handling and UX fallback; no auth, data, or core business-logic changes.
Overview
Prevents crashes in environments without usable GPU rendering by not mounting the R3F
Canvas/ WebGPU renderer when neither WebGPU nor WebGL is available, and by showing a small “3D viewer unavailable” message instead.After mount, capability checks run with an optimistic initial state to avoid SSR hydration mismatches. If WebGPURenderer
init()still fails, the same fallback is shown viarendererInitFailedinstead of leaving the canvas in a broken retry loop.When the fallback is active,
onSceneReadyChange(true)is fired so the host editor can dismiss its loader even thoughSceneReadyTrackernever mounts.Reviewed by Cursor Bugbot for commit 74fed4b. Bugbot is set up for automated code reviews on this repo. Configure here.