{"record":{"id":"a543ce325e1a77ed","repo":"remotion-dev/remotion","slug":"webgpu-is-not-available-in-this-environment-for-ca","errorCode":null,"errorMessage":"WebGPU is not available in this environment for canvas effect","messagePattern":"WebGPU is not available in this environment for canvas effect","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/effects/canvas-pool.ts","lineNumber":90,"sourceCode":"\t\t\t\tif (!ctx) {\n\t\t\t\t\tthrow createWebGL2ContextError('canvas effect');\n\t\t\t\t}\n\n\t\t\t\tcanvas.addEventListener('webglcontextlost', (e) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tthis.lostContexts.add(canvas);\n\t\t\t\t});\n\t\t\t\tcanvas.addEventListener('webglcontextrestored', () => {\n\t\t\t\t\tthis.lostContexts.delete(canvas);\n\t\t\t\t});\n\n\t\t\t\tctx.pixelStorei(ctx.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\t\t\t\treturn canvas;\n\t\t\t}\n\n\t\t\tcase 'webgpu': {\n\t\t\t\tif (typeof navigator === 'undefined' || !('gpu' in navigator)) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'WebGPU is not available in this environment for canvas effect',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn canvas;\n\t\t\t}\n\n\t\t\tdefault: {\n\t\t\t\tconst exhaustive: never = backend;\n\t\t\t\tthrow new Error(`Unknown effect backend: ${exhaustive as string}`);\n\t\t\t}\n\t\t}\n\t}\n}\n","sourceCodeStart":72,"sourceCodeEnd":105,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/effects/canvas-pool.ts#L72-L105","documentation":"When allocating a scratch canvas for a 'webgpu'-backend effect, CanvasPool checks for navigator.gpu. WebGPU must be enabled in the browser/runtime; if navigator.gpu is absent (older browsers, headless Chrome without the WebGPU flag, or Node/non-browser environments), the pool throws because the WebGPU effect cannot run.","triggerScenarios":"Using a WebGPU-based effect in a browser/runtime without WebGPU, headless Chrome launched without --enable-unsafe-webgpu / the WebGPU feature, or in SSR/Node where navigator is absent.","commonSituations":"Rendering on Lambda/headless Chrome that lacks WebGPU; older browser versions; effects authored for WebGPU running in a CI browser without flags.","solutions":["Use a WebGPU-capable browser/runtime (recent Chrome with WebGPU enabled; for headless, launch with the appropriate flags).","Switch the effect to a webgl2 or 2d backend if the target environment lacks WebGPU.","Feature-detect navigator.gpu before mounting WebGPU effects and provide a fallback."],"exampleFix":"// before\n<Effect backend=\"webgpu\" ... />\n\n// after (feature-detect)\nconst backend = typeof navigator !== 'undefined' && 'gpu' in navigator ? 'webgpu' : 'webgl2';\n<Effect backend={backend} ... />","handlingStrategy":"validation","validationCode":"const supportsWebGPU =\n  typeof navigator !== 'undefined' && 'gpu' in navigator;\nconst backend = supportsWebGPU ? 'webgpu' : 'webgl2';","typeGuard":"const supportsWebGPU = (): boolean =>\n  typeof navigator !== 'undefined' && 'gpu' in navigator;","tryCatchPattern":null,"preventionTips":["Feature-detect navigator.gpu before using WebGPU effects.","Provide a webgl2/2d fallback for environments without WebGPU.","Launch headless Chrome with WebGPU enabled when rendering."],"tags":["effects","webgpu","environment","canvas","feature-detection"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}