{"record":{"id":"f43114993becded0","repo":"remotion-dev/remotion","slug":"cannot-create-an-app-named-chalk-red-foldern","errorCode":null,"errorMessage":"Cannot create an app named ${chalk.red(`\"${folderName}\"`)}. ${validation}","messagePattern":"Cannot create an app named (.+?)\"`\\)\\}\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/create-video/src/resolve-project-root.ts","lineNumber":16,"sourceCode":"import fs from 'node:fs';\nimport {readdir, stat} from 'node:fs/promises';\nimport {tmpdir} from 'node:os';\nimport path from 'node:path';\nimport chalk from 'chalk';\nimport {Log} from './log';\nimport {mkdirp} from './mkdirp';\nimport prompts from './prompts';\nimport {isFlagSelected, isTmpFlagSelected} from './select-template';\nimport type {Template} from './templates';\nimport {validateName} from './validate-name';\n\nfunction assertValidName(folderName: string) {\n\tconst validation = validateName(folderName);\n\tif (typeof validation === 'string') {\n\t\tthrow new Error(\n\t\t\t`Cannot create an app named ${chalk.red(\n\t\t\t\t`\"${folderName}\"`,\n\t\t\t)}. ${validation}`,\n\t\t);\n\t}\n}\n\nfunction assertFolderEmptyAsync(projectRoot: string): {exists: boolean} {\n\tconst conflicts = fs\n\t\t.readdirSync(projectRoot)\n\t\t.filter((file: string) => !/\\.iml$/.test(file));\n\n\tif (conflicts.length > 0) {\n\t\tLog.newLine();\n\t\tLog.error(`Something already exists at \"${projectRoot}\"`);\n\t\tLog.error('Try using a new directory name, or moving these files.');\n\t\tLog.newLine();\n\t\treturn {exists: true};","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/create-video/src/resolve-project-root.ts#L1-L34","documentation":"Thrown by `assertValidName` in resolve-project-root when `validateName(folderName)` returns a string (i.e. validation failed) rather than `true`. validateName fails if the name is empty/non-string or contains characters outside the URL-friendly set `[a-z0-9@._-]`. The validation message is appended so the developer knows why the name is rejected.","triggerScenarios":"Passing a project folder name to create-video that is empty or contains characters not allowed by validateName (spaces, slashes, colons, emoji, etc.). E.g. `npx create-video my project` or a name with special punctuation.","commonSituations":"Typing a name with spaces at the CLI; using a path with slashes as the name; Unicode/emoji names; an empty positional argument.","solutions":["Use only alphanumeric characters plus @, ., -, and _ in the project name.","Replace spaces with hyphens: `my-project` instead of `my project`.","Quote the name if it must contain allowed punctuation, and avoid path separators."],"exampleFix":"// before\nnpx create-video \"my cool video\"\n\n// after\nnpx create-video my-cool-video","handlingStrategy":"validation","validationCode":"import {validateName} from './validate-name';\n\nconst result = validateName(folderName);\nif (result !== true) throw new Error(result);","typeGuard":"const isValidProjectName = (name: string): boolean =>\n  typeof name === 'string' && name !== '' && /^[a-z0-9@._-]+$/i.test(name);","tryCatchPattern":null,"preventionTips":["Restrict project names to [a-z0-9@._-].","Replace spaces with hyphens at the CLI.","Validate the name in your scaffolding script before calling create-video."],"tags":["create-video","validation","naming","cli"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}