Create-react-app: No files matching 'path/to/app/src/.' were found.

Created on 25 Oct 2020  路  29Comments  路  Source: facebook/create-react-app

Describe the bug

I have recently installed a new project with npx create-react-app my-app and tried to run it with npm start my-app.
There is an empty space in the path, in example:

'C:/some folder/my-app'
        ^

I receive a message:

Failed to compile
No files matching 'C:/some folder/my-app/src/.' were found.

If i use a path without empty spaces for my app, everything works fine.
Is important to note that this error started yesterday.

Which terms did you search for in User Guide?

I searched in the recent issues, but not found anything relevant. This problem started to happen yesterday, so I think it has to do with the new version, the previous one works fine.

Environment

The problem persist in Ubuntu and Windows, I tested in both.
npm 6.14.5
node 12.18.2

Steps to reproduce

  1. $mkdir './my project/app'
  2. $cd 'my project/app'
  3. $npx create-react-app my-app
  4. $cd my-app
  5. $npm run start

Expected behavior

New browser window opens with the React logo.

Actual behavior

Failed to compile

No files matching 'C:/my project/app/src/.' were found.

This error occurred during the build time and cannot be dismissed.

Regards

bug report needs triage

Most helpful comment

Check to ensure your ENTIRE absolute path to your project has no spaces or non-standard metacharacters in it...or move/re-create the project to a folder that complies. The main dropbox folder is a common culprit for spaces and parentheses. This is absolutely a bug and should be fixed.

All 29 comments

Same issue here! Couldnt find a solve

I found that if you Ctrl + C in the terminal and do npm start again, this error does not show again.

I found that if you Ctrl + C in the terminal and do npm start again, this error does not show again.

Tried it many times didnt work for me

Solved it with changing project directory to another disk and make it shorter. npm start and it worked.

Solved it with changing project directory to another disk and make it shorter. npm start and it worked.

Thats avoided, not solved!

Solved it with changing project directory to another disk and make it shorter. npm start and it worked.

That's what issue itself.

@pablozoani can you try

  • npm install -g create-react-app
  • create-react-app my-app instead of using npx

I remember there is a similar issue with the npx (https://github.com/facebook/create-react-app/issues/6512)

ctr c and npm run dev worked for me

Same issue here!

Check to ensure your ENTIRE absolute path to your project has no spaces or non-standard metacharacters in it...or move/re-create the project to a folder that complies. The main dropbox folder is a common culprit for spaces and parentheses. This is absolutely a bug and should be fixed.

I did everything from start, re-load the react and it started to work.

as mentioned by @elcontrastador. You just need to make sure every of your parent directory must not have spaces. I just encountered this issue, and this helps me fixed it.

For example, I have something like this before:- E:/React Projects/Personal Projects/Intermediate Projects/My Project A/client

this should change to:- E: ReactProjects/PersonalProjects/IntermediateProjects/MyProjectA/client

Now you can 'npm start' and your project should run and work just fine. As for why this bug occurs even I didn't know yet. Everything works fine before it happens. No changes made at all except making changes to my project CSS. Suddenly I got this error. Anyway, I'm glad everything works fine now.

I have the same issue. Plzzzzzz help!

@elcontrastador Thanks! It's working! :+1:

Check to ensure your ENTIRE absolute path to your project has no spaces or non-standard metacharacters in it...or move/re-create the project to a folder that complies. The main dropbox folder is a common culprit for spaces and parentheses. This is absolutely a bug and should be fixed.

That's exactly what happened. Thank you for this. Annoying as hell though with that bug.

thanks @elcontrastador it worked for me

@pablozoani can you try

* `npm install -g create-react-app`

* `create-react-app my-app` instead of using `npx`

I remember there is a similar issue with the npx (#6512)

Did work with ubuntu and react 17.0.1, didn't tried other OS

I have the same problem, my React localhost outputs this error message:

_"Failed to compile

No files matching 'Users/MyName/seasons/src/.' were found.

This error occurred during the build time and cannot be dismissed."_

My terminal also outputs a similar error message: _"Failed to compile...."_

I don't have any spaces in my path yet the error persists. I have created several react apps in the past without any issues.

Any help and or suggestions would be greatly appreciated.

I have the same problem
is there any solution up till now??
image

@elcontrastador your solution worked fine for me. It's just a parent directory naming issue. To those who encountered the error make sure your parent directory does not contain any spaces.

@shuchitpant In my case I was creating an app that required the use of my location which I had set to "Block", changing this to "Allow" got rid of the error and everything works fine now.

image
I'm also having the same issue, and I really can't change the directory name (it's my users's folder).

I used the globally installed create-react-app with the typescript template (create-react-app --template typescript).

@Efo-Koku where exactly can I allow the use of my location?

@DutchJelly
See my screenshot of the error message: "Failed to compile".
In the address bar where it says "localhost", click on the circled icon to the left and select the dropdown menu next to "Location".

Changing the location setting doesn't work for me. When I reload I do see my react page for a split second before it gives me the error, but the Location setting doesn't influence this.

So I figured I'd try it at the root of my C-drive, and that avoids the issue like others mentioned before.

Check to ensure your ENTIRE absolute path to your project has no spaces or non-standard metacharacters in it...or move/re-create the project to a folder that complies. The main dropbox folder is a common culprit for spaces and parentheses. This is absolutely a bug and should be fixed.

Thx! Removing the space from the project name resolved my issue

I fixed this just by running npm run start as mentioned above. The first time, when this failed, I used yarn start instead. Still not sure what happened under the hood.

Please help I have the same issue

I fixed this just by running npm run start as mentioned above. The first time, when this failed, I used yarn start instead. Still not sure what happened under the hood.

Thanks this worked

the issue because of space char in the path... just create a dir without spaces and it works just fine

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adrice727 picture adrice727  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

Aranir picture Aranir  路  3Comments

fson picture fson  路  3Comments

stopachka picture stopachka  路  3Comments