{"record":{"id":"272a0fceb451e90b","repo":"remotion-dev/remotion","slug":"tear-shader-compile-failed-log-no-log","errorCode":null,"errorMessage":"Tear shader compile failed: ${log ?? '(no log)'}","messagePattern":"Tear shader compile failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/tear.ts","lineNumber":193,"sourceCode":"}\n`;\n\nconst compileShader = (\n\tgl: WebGL2RenderingContext,\n\ttype: number,\n\tsource: string,\n): WebGLShader => {\n\tconst shader = gl.createShader(type);\n\tif (!shader) {\n\t\tthrow new Error('Failed to create WebGL shader');\n\t}\n\n\tgl.shaderSource(shader, source);\n\tgl.compileShader(shader);\n\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\tconst log = gl.getShaderInfoLog(shader);\n\t\tgl.deleteShader(shader);\n\t\tthrow new Error(`Tear shader compile failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn shader;\n};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/effects/src/tear.ts#L175-L211","documentation":"@remotion/effects' Tear effect compiles its GLSL vertex/fragment shaders with gl.compileShader() when the effect is first instantiated. If the GPU driver's shader compiler rejects the source (gl.COMPILE_STATUS false), the shader is deleted and this error is thrown with the driver's info log appended (or '(no log)' if the driver returned none). It means the shader source was invalid for this WebGL2 context/driver, not a problem with your video or props.","triggerScenarios":"Calling the Tear effect (directly or via <Tear>) on a machine whose WebGL2 driver fails to compile the effect's built-in #version 300 es GLSL shaders — e.g. driver GLSL compiler bugs, a context forced to a lower GLSL version via getContext attributes, or ANGLE/driver quirks on outdated GPU drivers.","commonSituations":"Running headless rendering or CI with SwiftShader/llvmpipe software GL that mishandles GLSL ES 3.00; outdated or buggy GPU drivers (especially older Intel/ANGLE combos); creating the canvas context with non-default options; browser/GPU driver regressions after an update.","solutions":["Read the appended log in the message to see the exact GLSL compile error and offending line","Update GPU drivers / browser to a current version","If headless, switch to a real GPU or a newer Chrome with working ANGLE/SwiftShader","Check the context was created as 'webgl2' without attributes that downgrade the shader version","Report the driver/log to Remotion if the shader fails on up-to-date setups"],"exampleFix":"// before (headless CI with broken software GL)\nconst canvas = document.createElement('canvas');\n// after (force hardware-accelerated GL flags when launching the browser)\n// chrome --use-angle=default --enable-unsafe-swiftshader=false","handlingStrategy":"try-catch","validationCode":"const gl = canvas.getContext('webgl2');\nif (!gl) throw new Error('WebGL2 not supported in this environment');\nconst probe = gl.createShader(gl.VERTEX_SHADER);\nif (!probe) throw new Error('GL shader objects unavailable');\ngl.shaderSource(probe, '#version 300 es\\nvoid main(){}');\ngl.compileShader(probe);\nconst ok = gl.getShaderParameter(probe, gl.COMPILE_STATUS);\ngl.deleteShader(probe);\nif (!ok) throw new Error('GLSL ES 3.00 unsupported: ' + gl.getShaderInfoLog(probe));","typeGuard":"function isWebGL2Healthy(gl: WebGL2RenderingContext): boolean {\n  return !gl.isContextLost() && typeof gl.createShader === 'function';\n}","tryCatchPattern":"try {\n  renderWithTear(...);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Tear shader compile failed')) {\n    // fall back to a CPU/canvas effect or skip the effect for this frame\n    console.warn('GLSL compile failed on this driver:', err.message);\n  } else throw err;\n}","preventionTips":["Verify WebGL2 + GLSL ES 3.00 support before using Tear","Keep GPU drivers and browsers updated, especially in CI containers","Prefer hardware GL over old SwiftShader/llvmpipe in headless runs","Don't create the context with attributes that downgrade the GLSL version"],"tags":["webgl","glsl","shader-compile","gpu"],"backgroundTag":"shader-compile-failed","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}