remotion-dev/remotion · error · Error

Failed to create texture

Error message

Failed to create texture

What it means

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.

Source

Thrown at packages/transitions/src/presentations/blur-slide.tsx:145

	const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);
	const fs = compileShader(gl, fragmentShader, gl.FRAGMENT_SHADER);
	gl.attachShader(program, vs);
	gl.attachShader(program, fs);
	gl.linkProgram(program);
	if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
		const log = gl.getProgramInfoLog(program);
		gl.deleteProgram(program);
		throw new Error(`Failed to link program: ${log}`);
	}

	return program;
};

const createTexture = (gl: WebGL2RenderingContext): WebGLTexture => {
	const tex = gl.createTexture();
	if (!tex) {
		throw new Error('Failed to create texture');
	}

	gl.bindTexture(gl.TEXTURE_2D, tex);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
	gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
	gl.texImage2D(
		gl.TEXTURE_2D,
		0,
		gl.RGBA,
		1,
		1,
		0,
		gl.RGBA,
		gl.UNSIGNED_BYTE,
		new Uint8Array([0, 0, 0, 0]),
	);

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Release previously created WebGL textures (deleteTexture) and reduce concurrent transitions
  2. Recreate the OffscreenCanvas and call blurSlide() again to get a fresh context
  3. Check hardware acceleration / WebGL2 support and free system GPU memory
  4. Catch and fall back to a DOM-based presentation

Example fix

// before
const tex = gl.createTexture();
// after
const tex = gl.createTexture();
if (!tex) {
  // free stale textures elsewhere, then retry with a fresh context
}
Defensive patterns

Strategy: try-catch

Validate before calling

null

Try / catch

try {
  const slide = blurSlide(props);
} catch (err) {
  if (String(err).includes('Failed to create texture')) {
    // free textures, recreate context, retry once with fallback
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: Rendering many concurrent canvas-based transitions that leak textures; low-memory devices; browsers limiting GPU allocations per page/tab.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09). Data as JSON: /api/errors/7cb7c665312ecf4d. Report an issue: GitHub.