remotion-dev/remotion · critical · Error
Failed to create WebGL vertex array
Error message
Failed to create WebGL vertex array
What it means
Thrown by `setupBurlap` when `gl.createVertexArray()` returns `null`. The VAO holds the burlap fullscreen-quad bindings (aPos/aUv). A null result is a resource/context-loss condition, not a usage mistake.
Source
Thrown at packages/effects/src/burlap.ts:295
premultipliedAlpha: true,
alpha: true,
preserveDrawingBuffer: true,
});
if (!gl) {
throw createWebGL2ContextError('burlap effect');
}
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
const vs = compileShader(gl, gl.VERTEX_SHADER, BURLAP_VS);
const fs = compileShader(gl, gl.FRAGMENT_SHADER, BURLAP_FS);
const program = linkProgram(gl, vs, fs);
gl.deleteShader(vs);
gl.deleteShader(fs);
const vao = gl.createVertexArray();
if (!vao) {
throw new Error('Failed to create WebGL vertex array');
}
gl.bindVertexArray(vao);
const data = new Float32Array([
-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,
]);
const vbo = gl.createBuffer();
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');View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Guard with `gl.isContextLost()`; reinitialize after `webglcontextrestored`.
- Free unused burlap states via burlap `cleanup`.
- Limit concurrent WebGL effects.
- Ensure hardware-accelerated WebGL2.
Example fix
if (gl.isContextLost()) {
// reinitialize after restore
} else {
burlap.setup(canvas);
} Defensive patterns
Strategy: try-catch
Validate before calling
if (gl.isContextLost()) { /* skip setupBurlap */ } Try / catch
try {
burlap.setup(canvas);
} catch (err) {
if (/Failed to create WebGL vertex array/.test(err.message)) {
// await restore or reduce effects, then retry
} else { throw err; }
} Prevention
- Release VAOs via burlap cleanup on unused states.
- Handle context-loss events.
- Cap concurrent active effects.
When it happens
Trigger: Fires at line 293-295, after the program is created and shaders deleted, when `gl.createVertexArray()` yields null.
Common situations: Context loss during burlap setup; VAO cap reached by many concurrent effects; software renderer with low object limits.
Related errors
- Failed to create WebGL vertex array
- Failed to create WebGL vertex array
- Failed to create WebGL shader
- Failed to create WebGL program
- Failed to create WebGL buffer
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/89978fe6094b53ce.
Report an issue: GitHub.