gatsbyjs/gatsby · error
The destination "${value}" is not a valid filename. Please t
Error message
The destination "${value}" is not a valid filename. Please try again, avoiding special characters. What it means
Validation-helper warning from create-gatsby's project name validator: after trimming, the supplied directory name matched the INVALID_FILENAMES regex (characters invalid on filesystems, e.g. control or special characters). The validator returns false so the name is rejected.
Source
Thrown at packages/create-gatsby/src/utils/question-helpers.ts:42
return entries
}
const none = { name: `none`, message: `No (or I'll add it later)` }
const divider = { name: `–`, role: `separator`, message: `–` }
return [none, divider, ...entries]
}
export function validateProjectName(value: string): boolean {
if (!value) {
reporter.warn(
`You have not provided a directory name for your site. Please do so when running with the 'y' flag.`
)
return false
}
value = value.trim()
if (INVALID_FILENAMES.test(value)) {
reporter.warn(
`The destination "${value}" is not a valid filename. Please try again, avoiding special characters.`
)
return false
}
if (process.platform === `win32` && INVALID_WINDOWS.test(value)) {
reporter.warn(
`The destination "${value}" is not a valid Windows filename. Please try another name`
)
return false
}
if (fs.existsSync(path.resolve(value))) {
reporter.warn(
`The destination "${value}" already exists. Please choose a different name`
)
return false
}
return true
}View on GitHub (pinned to e85d62f177)
Solutions
- Choose a directory name without special characters (letters, digits, dashes, underscores)
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/create-gatsby/src/utils/question-helpers.ts:42 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26).
Data as JSON: /api/errors/052b07aa03c54ca9.
Report an issue: GitHub.