remotion-dev/remotion · error · Error

Could not split video from audio

Error message

Could not split video from audio

What it means

Returned as `{success: false, reason}` by splitVideoFromAudio in @remotion/browser-studio. The split codemod produced new file contents, but `controller.applyMutation(...)` with the node-path remappings returned null — the controller could not apply the mutation to its tracked state. The overwhelmingly common cause is a stale `nodePath` for the <Video> node being split.

Source

Thrown at packages/browser-studio/src/browser-studio-operations.ts:1921

					nodePath,
					formatFile: formatCodemodFile,
				});
				const nodePathMutation = controller.applyMutation({
					timelineSelection: null,
					fileName: absolutePath,
					mutate: () => ({
						...project,
						files: {...project.files, [absolutePath]: result.output},
					}),
					nodePathMutationFiles: [
						{
							absolutePath,
							remappings: result.nodePathRemappings,
						},
					],
				});
				if (nodePathMutation === null) {
					throw new Error('Could not split video from audio');
				}

				return {success: true, nodePathMutation};
			} catch (error) {
				return {
					success: false,
					reason: error instanceof Error ? error.message : String(error),
					stack: error instanceof Error && error.stack ? error.stack : '',
				};
			}
		};

	const insertJsxElement: BrowserStudioOperations['insertJsxElement'] = async (
		request,
	) => {
		try {
			const requiredPackage = getRequiredPackageForInsertableElement(
				request.element,

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Re-resolve the video node's path from the current project state and retry
  2. Confirm the target node is still a video element at that path
  3. Serialize mutations so paths cannot change between read and write
  4. Report a bug with file contents if it fails on freshly resolved paths

Example fix

// before
await operations.splitVideoFromAudio({fileName, nodePath: cachedPath});

// after
const nodePath = await resolveCurrentVideoNodePath(fileName);
const res = await operations.splitVideoFromAudio({fileName, nodePath});
if (!res.success) {
  await refreshTimeline(); // paths went stale, let user retry
}
Defensive patterns

Strategy: validation

Validate before calling

const nodePath = await resolveCurrentVideoNodePath(fileName);
if (nodePath === null) throw new Error('No video node found to split');
const res = await operations.splitVideoFromAudio({fileName, nodePath});
if (!res.success) await refreshTimeline();

Prevention

When it happens

Trigger: Calling `splitVideoFromAudio({fileName, nodePath})` where nodePath pointed at a video node that has since moved or been removed; splitting while another mutation is in flight; nodePath computed from an older version of the file.

Common situations: Context-menu 'split video/audio' in a custom editor using cached node paths; undo/redo between selection and the split action; concurrent edits from a second client.

Related errors


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