remotion-dev/remotion · error · Error
Could not find a JSX element at the specified location to…
Error message
Could not find a JSX element at the specified location to split audio from
What it means
splitVideoFromAudio throws this when findJsxElementPathForDeletion cannot locate a JSX element at the supplied nodePath in the parsed AST. The nodePath (a Studio sequence node path) does not resolve to a JSX element in the current source, so there is nothing to split audio from.
Solutions
- Reload the file/Studio so the node path is re-captured against the current source
- Confirm the file on disk hasn't changed since the path was created
- Verify the nodePath targets an actual JSX element in the composition
- Re-open the composition and retry the split-audio action
Example fix
// before (stale path from previous file version)
splitVideoFromAudio({input: currentInput, nodePath: oldCapturedPath});
// after (recapture path from current AST)
const ast = parseAst(currentInput);
const nodePath = captureSequenceNodePath(ast, currentSelection);
splitVideoFromAudio({input: currentInput, nodePath}); Defensive patterns
Strategy: validation
Validate before calling
const ast = parseAst(input);
const jsxPath = findJsxElementPathForDeletion(ast, nodePath);
if (!jsxPath) throw new Error('nodePath does not resolve to a JSX element in the current source'); Try / catch
try {
const result = await splitVideoFromAudio({input, nodePath});
} catch (e) {
if (e instanceof Error && e.message.startsWith('Could not find a JSX element')) {
const freshPath = captureSequenceNodePath(parseAst(input), selection); // recapture against current source
return splitVideoFromAudio({input, nodePath: freshPath});
}
throw e;
} Prevention
- Recapture node paths immediately before invoking the codemod
- Reload the Studio/file when the source on disk changed externally
- Verify the target node is a JSX element, not a Sequence or fragment
When it happens
Trigger: Calling splitVideoFromAudio({input, nodePath}) where nodePath points to a node that is not a JSX element (e.g. a Sequence wrapper, fragment, expression), the file changed since the path was captured, or the path indices no longer match the AST.
Common situations: Studio out of sync with the file on disk (edits made outside the Studio), stale sequence paths after hot reload or code reformat, or passing a path captured from a different file.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Could not delete JSX nodes
- Could not duplicate JSX node
- Could not split JSX sequence
- A folder cannot be moved inside itself
- A folder named " " already exists in the destination
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/6670fd83ad9ddbef.
Report an issue: GitHub.
Appendix: source
Thrown at packages/studio-codemods/src/split-video-from-audio.ts:411
// replaced the full-file formatting pass.
formatFile?: (input: {
contents: string;
prettierConfigOverride: Record<string, unknown> | null;
}) => Promise<{output: string; formatted: boolean}>;
prettierConfigOverride?: Record<string, unknown> | null;
}): Promise<{
output: string;
formatted: boolean;
nodeLabel: string;
logLine: number;
nodePathRemappings: SequenceNodePathRemapping[];
}> => {
const ast = parseAst(input);
const capturedNodePaths = captureJsxNodePaths(ast);
const importSnapshots = captureImportSnapshots(ast);
const jsxPath = findJsxElementPathForDeletion(ast, nodePath);
if (!jsxPath) {
throw new Error(
'Could not find a JSX element at the specified location to split audio from',
);
}
const jsxElement = jsxPath.node as JSXElement;
const nodeLabel = getJsxElementTagLabel(jsxElement);
if (jsxElement.openingElement.name.type !== 'JSXIdentifier') {
throw new Error(`Cannot split audio from <${nodeLabel}>`);
}
const tagName = jsxElement.openingElement.name.name;
const importSource = findImportSourceOfLocalName(ast, tagName);
if (!importSource) {
throw new Error(`Could not find the import of <${tagName}>`);
}
const hasSrc = jsxElement.openingElement.attributes.some(View on GitHub (pinned to 46a3a6bf13)