Skip to content

fix(create-vite): filter invalid directory name characters (fix#21579

Open
francescopesoli wants to merge 2 commits intovitejs:mainfrom
francescopesoli:fix/invalid-dir-chars
Open

fix(create-vite): filter invalid directory name characters (fix#21579
francescopesoli wants to merge 2 commits intovitejs:mainfrom
francescopesoli:fix/invalid-dir-chars

Conversation

@francescopesoli
Copy link

Summary

  • Filter out characters that are invalid for directory names (`< > : " \ |
    ? *`) in the `formatTargetDir` function
  • These characters cause `ENOENT` errors on Windows and most filesystems
    when creating the project directory
  • Follows the existing pattern of silently removing invalid characters (like
    trailing slashes)

Related Issue

Fixes #21550

Test Plan

  • Run `pnpm create vite` locally
  • Enter a project name with invalid characters (e.g., `test:project`,
    `my|app`)
  • Verify the project is created successfully with the invalid characters
    stripped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project name in create vite command should not allow the use of < > : " / \ | ? * characters

1 participant