remotion-dev/remotion · error
assetPath must be a non-empty public-folder path, or an…
Error message
assetPath must be a non-empty public-folder path, or an asset must be selected in Studio.
What it means
The WebMcp asset tool resolves the asset path from the explicit assetPath argument or the currently selected Studio content. If neither yields a non-empty string, it throws because it cannot determine which public-folder asset to operate on.
Solutions
- Pass an explicit non-empty assetPath pointing at a file in public/ (e.g. 'audio/voice.mp3').
- Select the desired asset in Remotion Studio before invoking the tool.
- Double-check the argument spelling — assetPath, not src or path.
- List static files first to pick a valid public-folder path.
Example fix
// before
await tool.execute({}); // no selection
// after
await tool.execute({assetPath: 'audio/voice.mp3'}); Defensive patterns
Strategy: type-guard
Validate before calling
if (typeof assetPath !== 'string' || assetPath.length === 0) {
throw new Error('assetPath is required when no asset is selected.');
} Type guard
const hasAssetPath = (a: unknown): a is string => typeof a === 'string' && a.length > 0;
Try / catch
try {
const p = resolveAssetPath(input);
} catch (e) {
if (e.message.includes('assetPath must be a non-empty')) {
return 'No asset selected — pass assetPath explicitly.';
}
} Prevention
- Always pass assetPath explicitly from tooling.
- Select an asset in Studio before invoking selection-less calls.
- Validate non-empty string inputs before tool calls.
When it happens
Trigger: Calling the WebMcp asset tool with assetPath omitted while no asset is selected in Studio, or passing assetPath: '' / non-string.
Common situations: MCP agent calls the tool without arguments expecting the selection to provide context; Studio opened without selecting an asset; a script sending an empty string path.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Composition not found.
- frame must be an integer.
- The artifact filename
- visible must be a boolean.
- Asset was not found in public/.
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-09).
Data as JSON: /api/errors/ff37d4c99fbe891d.
Report an issue: GitHub.
Appendix: source
Thrown at packages/studio/src/components/WebMcp.tsx:184
assetPath,
currentContent,
staticFiles,
}: {
readonly assetPath: unknown;
readonly currentContent: {
readonly asset?: string;
readonly type: string;
} | null;
readonly staticFiles: readonly {readonly name: string}[];
}) => {
const resolvedAssetPath =
assetPath === undefined
? currentContent?.type === 'asset'
? (currentContent.asset ?? null)
: null
: assetPath;
if (typeof resolvedAssetPath !== 'string' || resolvedAssetPath.length === 0) {
throw new Error(
'assetPath must be a non-empty public-folder path, or an asset must be selected in Studio.',
);
}
if (!staticFiles.some((file) => file.name === resolvedAssetPath)) {
throw new Error(`Asset ${resolvedAssetPath} was not found in public/.`);
}
return resolvedAssetPath;
};
const WebMcpSelectionSync: FC<{
readonly currentSelectionRef: MutableRefObject<string | null>;
readonly selectedSequenceRef: MutableRefObject<WebMcpSequence | null>;
}> = ({currentSelectionRef, selectedSequenceRef}) => {
const {selectedItems} = useTimelineSelection();
const {sequences} = useContext(Internals.SequenceManager);
const {overrideIdToNodePathMappings} = useContext(View on GitHub (pinned to 46a3a6bf13)