Repository navigation
fix(blocks): Globe block falls back when WebGL is unavailable - #510
Conversation
docs.once-ui.com/blocks/widgets crashed in Firefox with "THREE.WebGLRenderer: Error creating WebGL context": the globe threw and took the page down. Globe1 now checks for WebGL before loading react-globe.gl, catches a failure it could not predict, and draws a flat sphere instead. Every block preview on the blocks pages also gets its own error boundary, so one failing block can no longer break the page. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
|
The visual check flagged two shots on The branch was also behind Generated by Claude Code |
|
After the sync, the visual check flagged a different single shot: Generated by Claude Code |
|
The re-run flagged the same shot again: I'm not adding Generated by Claude Code |
Requested by Lorant · project thread
What
A user reported that docs.once-ui.com/blocks/widgets crashes in Firefox with "THREE.WebGLRenderer: Error creating WebGL context." The error takes down the whole page and shows the "Dang! It's broken" screen. The cause is the
Globe1block (react-globe.gl on three.js). When the browser can't create a WebGL context, three.js throws: hardware acceleration may be off, the GPU may be blocked, or the browser may be out of contexts. The filmstrip and the focus view each mount their own copy of the block.Globe1checks for WebGL before it loads react-globe.gl, and releases the test context right away. If there's no WebGL, it draws a flat outlined sphere instead. A small error boundary around the globe catches failures the check can't predict, such as running out of contexts or a GPU crash, and shows the same sphere. The fix lives in the block itself, so apps that copy the block get it too.BlockErrorBoundarywraps every preview, both the filmstrip thumbnails and the main preview. Any block that throws now shows "This preview can't run in this browser" inside its own frame, and the code and the rest of the page keep working.Audit
packages/coreMascotCubealready catches renderer creation.src/effects/*and the home die callgetContext("webgl2")and handlenull, which is how a raw context fails, so they're safe.Globe1from core at the commit pinned inblocks.source.json. They pick up the fix when that pin moves.Checks
/blocks/widgetsin Chromium with--disable-webgl --disable-3d-apis: the page renders, the Globe1 thumbnail shows the fallback sphere, and there are no page errors.Generated by Claude Code