{"record":{"id":"7d4ab4b0db5937e2","repo":"remotion-dev/remotion","slug":"unknown-remotion-skill-json-stringify-skill","errorCode":null,"errorMessage":"Unknown Remotion skill: ${JSON.stringify(skill)}","messagePattern":"Unknown Remotion skill: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio-server/src/preview-server/routes/install-remotion-skill.ts","lineNumber":27,"sourceCode":"import {remotionSkillNames} from '../../remotion-skill-names';\nimport type {ApiHandler} from '../api-types';\nimport {getPackageManager} from '../get-package-manager';\nimport {getRemotionSkillsInfo} from './remotion-skills-info';\n\nconst changingSkillsInProjects = new Set<string>();\n\nconst changeRemotionSkill = async ({\n\taction,\n\tremotionRoot,\n\tinput: {skill},\n\tlogLevel,\n}: Parameters<\n\tApiHandler<InstallRemotionSkillRequest, GetRemotionSkillsInfoResponse>\n>[0] & {\n\treadonly action: 'install' | 'remove';\n}): Promise<GetRemotionSkillsInfoResponse> => {\n\tif (!remotionSkillNames.some((name) => name === skill)) {\n\t\tthrow new Error(`Unknown Remotion skill: ${JSON.stringify(skill)}`);\n\t}\n\n\tif (changingSkillsInProjects.has(remotionRoot)) {\n\t\tthrow new Error(\n\t\t\t'A skill is already being installed or removed. Please try again once it finishes.',\n\t\t);\n\t}\n\n\tchangingSkillsInProjects.add(remotionRoot);\n\ttry {\n\t\tconst installedSkill = getRemotionSkillsInfo({remotionRoot}).skills.find(\n\t\t\t({name}) => name === skill,\n\t\t);\n\t\tconst removingGlobally =\n\t\t\taction === 'remove' &&\n\t\t\tinstalledSkill?.installedInProject === false &&\n\t\t\tinstalledSkill.installedGlobally;\n\t\tif (","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-server/src/preview-server/routes/install-remotion-skill.ts#L9-L45","documentation":"changeRemotionSkill validates the requested skill name against the known remotionSkillNames list before installing or removing it. If the name does not match any known Remotion skill, this error is thrown so the request fails fast instead of passing an invalid package name to the package manager. The skill name is echoed back as JSON for easy debugging.","triggerScenarios":"Calling installRemotionSkillHandler or removeRemotionSkillHandler (the install-remotion-skill API route) with a `skill` value that is not in remotionSkillNames — e.g. a typo, a non-Remotion package name, or a stale skill name from an older Remotion version.","commonSituations":"A Studio client or automation script requests a skill with a misspelled or outdated name; the Remotion version on disk does not ship the requested skill; a hand-crafted API call passes an arbitrary string.","solutions":["Check the exact skill name against the list returned by the get-remotion-skills-info endpoint and correct the request","Upgrade Remotion so the desired skill exists in remotionSkillNames","Pass only skill names surfaced by the Studio UI rather than hand-typing them"],"exampleFix":"// before\nawait fetch('/api/install-remotion-skill', {body: JSON.stringify({skill: 'captions ')})\n// after\nawait fetch('/api/install-remotion-skill', {body: JSON.stringify({skill: '@remotion/captions'})})","handlingStrategy":"validation","validationCode":"import {remotionSkillNames} from '@remotion/studio-server'; // or read from skills info API\nif (!remotionSkillNames.includes(skill)) {\n  throw new Error(`Unknown skill: ${skill}`);\n}","typeGuard":"const isKnownSkill = (s: string): s is RemotionSkillName =>\n  remotionSkillNames.some((name) => name === s);","tryCatchPattern":"try {\n  await installSkill(skill);\n} catch (e) {\n  if (e.message.startsWith('Unknown Remotion skill')) {\n    // correct the skill name and retry\n  }\n}","preventionTips":["Always take skill names from the skills-info API response, never type them by hand","Keep Remotion upgraded so the skill list matches available skills","Validate user input against remotionSkillNames before calling the route"],"tags":["validation","studio","skill-install"],"backgroundTag":"invalid-enum-value","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}