{"record":{"id":"7b34651f99d85682","repo":"remotion-dev/remotion","slug":"creating-canvas-capture-compositions-is-not-suppor","errorCode":null,"errorMessage":"Creating canvas capture compositions is not supported in Browser Studio","messagePattern":"Creating canvas capture compositions is not supported in Browser Studio","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":1456,"sourceCode":"\t};\n\n\tconst applyCodemod: BrowserStudioOperations['applyCodemod'] = async ({\n\t\tcodemod,\n\t\tdryRun,\n\t\tsymbolicatedStack,\n\t}) => {\n\t\ttry {\n\t\t\tif (codemod.type === 'apply-visual-control') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Applying visual controls is not supported in Browser Studio',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcodemod.type === 'new-composition' &&\n\t\t\t\tcodemod.canvasCapture !== null\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Creating canvas capture compositions is not supported in Browser Studio',\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst project = getProject();\n\t\t\tconst absolutePath = resolveCodemodTargetFile({\n\t\t\t\tcodemod,\n\t\t\t\tproject,\n\t\t\t\tsymbolicatedStack,\n\t\t\t});\n\t\t\tconst input = project.files[absolutePath];\n\t\t\tconst {newContents} = parseAndApplyCodemod({input, codeMod: codemod});\n\t\t\tconst {output} = await formatCodemodFile({contents: newContents});\n\t\t\tconst files: Record<string, string> = {\n\t\t\t\t...project.files,\n\t\t\t\t[absolutePath]: output,\n\t\t\t};\n","sourceCodeStart":1438,"sourceCodeEnd":1474,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/browser-studio/src/browser-studio-operations.ts#L1438-L1474","documentation":"applyCodemod rejects 'new-composition' codemods that carry a non-null canvasCapture payload. Canvas Capture compositions are produced by the Remotion Chrome extension recording flow and require a native project; Browser Studio cannot create them, so the codemod is refused with a structured error.","triggerScenarios":"Calling applyCodemod with {type: 'new-composition', canvasCapture: {...}, ...} — i.e. a new-composition codemod whose canvasCapture field is anything other than null.","commonSituations":"Replaying Studio-created canvas capture workflows in the browser embed; sharing composition-creation code paths between Studio and Browser Studio without gating the canvasCapture option.","solutions":["Set canvasCapture: null on new-composition codemods sent to Browser Studio.","Gate the canvas capture flow on host capabilities and show it only where it is supported.","Create the composition first without canvasCapture, then handle capture separately in a supported host."],"exampleFix":"// before\nconst codemod = {type: 'new-composition', canvasCapture, ...};\nawait operations.applyCodemod({codemod, dryRun: false, symbolicatedStack: null});\n\n// after\nconst codemod = {type: 'new-composition', canvasCapture: null, ...};\nawait operations.applyCodemod({codemod, dryRun: false, symbolicatedStack: null});","handlingStrategy":"type-guard","validationCode":"if (!(codemod.type === 'new-composition' && codemod.canvasCapture !== null)) {\n  await operations.applyCodemod({codemod, dryRun, symbolicatedStack});\n}","typeGuard":"const isBrowserStudioSupportedNewComposition = (\n  codemod: RecastCodemod,\n): boolean =>\n  codemod.type !== 'new-composition' || codemod.canvasCapture === null;","tryCatchPattern":"try {\n  await operations.applyCodemod({codemod, dryRun, symbolicatedStack});\n} catch (error) {\n  if (\n    error instanceof Error &&\n    error.message ===\n      'Creating canvas capture compositions is not supported in Browser Studio'\n  ) {\n    // retry with canvasCapture: null or route the capture flow to a supported host\n  }\n}","preventionTips":["Strip canvasCapture from new-composition codemods destined for Browser Studio.","Gate canvas capture UI on a host capability check.","Create plain compositions first; run capture in a host that supports the extension flow."],"tags":["codemod","composition","canvas-capture","unsupported","capability"],"backgroundTag":"unsupported-operation","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}