{"record":{"id":"7cb7c665312ecf4d","repo":"remotion-dev/remotion","slug":"failed-to-create-texture","errorCode":null,"errorMessage":"Failed to create texture","messagePattern":"Failed to create texture","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/transitions/src/presentations/blur-slide.tsx","lineNumber":145,"sourceCode":"\n\tconst vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n\tconst fs = compileShader(gl, fragmentShader, gl.FRAGMENT_SHADER);\n\tgl.attachShader(program, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Failed to link program: ${log}`);\n\t}\n\n\treturn program;\n};\n\nconst createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {\n\tconst tex = gl.createTexture();\n\tif (!tex) {\n\t\tthrow new Error('Failed to create texture');\n\t}\n\n\tgl.bindTexture(gl.TEXTURE_2D, tex);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\tgl.texImage2D(\n\t\tgl.TEXTURE_2D,\n\t\t0,\n\t\tgl.RGBA,\n\t\t1,\n\t\t1,\n\t\t0,\n\t\tgl.RGBA,\n\t\tgl.UNSIGNED_BYTE,\n\t\tnew Uint8Array([0, 0, 0, 0]),\n\t);","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/transitions/src/presentations/blur-slide.tsx#L127-L163","documentation":"Thrown by createTexture when gl.createTexture() returns null, meaning a texture object could not be allocated on the current WebGL2 context. Like program creation failure, this indicates exhausted GPU resources or a lost/invalid context.","triggerScenarios":"blurSlide() allocates three textures (prevTex, nextTex, intermediateTex); a null return on any allocation raises this. Happens when GPU texture memory is exhausted or the context is lost.","commonSituations":"Rendering many concurrent canvas-based transitions that leak textures; low-memory devices; browsers limiting GPU allocations per page/tab.","solutions":["Release previously created WebGL textures (deleteTexture) and reduce concurrent transitions","Recreate the OffscreenCanvas and call blurSlide() again to get a fresh context","Check hardware acceleration / WebGL2 support and free system GPU memory","Catch and fall back to a DOM-based presentation"],"exampleFix":"// before\nconst tex = gl.createTexture();\n// after\nconst tex = gl.createTexture();\nif (!tex) {\n  // free stale textures elsewhere, then retry with a fresh context\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"try {\n  const slide = blurSlide(props);\n} catch (err) {\n  if (String(err).includes('Failed to create texture')) {\n    // free textures, recreate context, retry once with fallback\n  }\n}","preventionTips":["Always deleteTexture on cleanup of canvas transitions","Avoid mounting many WebGL transitions concurrently","Monitor GPU memory on target devices","Recreate OffscreenCanvas when a context is lost"],"tags":["webgl","gpu","texture"],"backgroundTag":"module-init-failed","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}