create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

cannot build projects when cwd contains a pathname with !

Open devkral opened this issue 1 year ago • 1 comments

Describe the bug

When having an ! in the build path (the cwd not the project name contains an !), react-scripts fails with a cryptic error.

This is quite easy to reproduce.

Steps to reproduce

(Write your steps here:)

  1. create a directory name with ! in it's name, e.g. foo/!A_Kabumm/
  2. switch to the directory
  3. npx create-react-app my-app
  4. cd my-app
  5. npm start

The last command crashes with: configuration.cache.cacheDirectory: The provided value "/home/alex/tmp/!A_foo/my-app/node_modules/.cache" contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.

Expected behavior

It doesn't crash.

I am not sure if it is actually a webpack bug but I found it because of this project.

devkral avatar Jun 09 '24 02:06 devkral

sry it seems to be a webpack bug. Close or keep and warn the users?

devkral avatar Jun 09 '24 02:06 devkral