remotion-dev/remotion · error · Error
Failed to create WebGL texture
Error message
Failed to create WebGL texture
What it means
Thrown by setupBurlap when gl.createTexture() returns null while allocating the source texture used to upload frames into the burlap shader. createTexture() returns null for the same reasons as other GL object creators: lost context, exhausted GPU texture memory, or too many live textures. Without the texture the effect has nothing to sample, so setup aborts.
Source
Thrown at packages/effects/src/burlap.ts:323
if (!vbo) {
throw new Error('Failed to create WebGL buffer');
}
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);
const aPos = gl.getAttribLocation(program, 'aPos');
const aUv = gl.getAttribLocation(program, 'aUv');
gl.enableVertexAttribArray(aPos);
gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 16, 0);
gl.enableVertexAttribArray(aUv);
gl.vertexAttribPointer(aUv, 2, gl.FLOAT, false, 16, 8);
gl.bindVertexArray(null);
const texture = gl.createTexture();
if (!texture) {
throw new Error('Failed to create WebGL texture');
}
gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.bindTexture(gl.TEXTURE_2D, null);
const colorCanvas = document.createElement('canvas');
colorCanvas.width = 1;
colorCanvas.height = 1;
const colorCtx = colorCanvas.getContext('2d', {willReadFrequently: true});
if (!colorCtx) {
throw new Error('Failed to acquire 2D context for color parsing');
}
return {View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Free WebGL resources from other effects/compositions before initializing burlap (call the effect cleanup paths).
- Lower the composition resolution or reduce concurrent compositions to cut peak texture memory.
- Enable GPU acceleration in the render environment (avoid --disable-gpu / pure software raster).
- Handle 'webglcontextlost' on the canvas and re-run setupBurlap after 'webglcontextrestored'.
- Update GPU drivers; verify the GPU is not blacklisted by the browser.
Defensive patterns
Strategy: try-catch
Validate before calling
function probeWebGL2(): boolean {
try {
const c = document.createElement('canvas');
const gl = c.getContext('webgl2');
return !!gl && !gl.isContextLost();
} catch {
return false;
}
}
if (!probeWebGL2()) skipOrFallback(); Try / catch
try {
return <Burlap {...props} />;
} catch (err) {
if (/Failed to create WebGL texture/.test(String(err))) return <FallbackFrame />;
throw err;
} Prevention
- Tear down other effects' GL resources before initializing burlap to free texture memory.
- Render at the lowest acceptable resolution to reduce per-texture VRAM.
- Prefer GPU-accelerated rendering environments over software rasterizers.
- Reuse a single composition/canvas rather than spinning up many.
When it happens
Trigger: setupBurlap() reaches gl.createTexture() at burlap.ts:321 after the VAO/VBO were built; the call returns null (context lost or GPU texture memory exhausted) and the guard at :322 throws.
Common situations: Large/many compositions consuming GPU texture memory, integrated GPUs with limited VRAM, software rendering (SwiftShader) under load, rendering at very high resolutions where prior textures were not freed, or a context-loss event between VBO and texture creation.
Related errors
- Failed to create WebGL buffer
- Failed to create WebGL texture
- Failed to create WebGL texture
- Failed to create WebGL shader
- Checkerboard shader compile failed: ${log ?? '(no log)'}
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/582c32cb93078897.
Report an issue: GitHub.