React Deployment - Cannot find file

Hi Guys,

Been trying to deploy my React app for a couple hours now.
It builds fine locally.

I’ve tried removing the yarn.lock file, changing the build script to ‘npm react-scripts build’, checked for letter-casing issues.

My instance name is ’ happy-goodall-7b90ff’
The errors I’m getting are:

failed during stage ‘building site’: Build script returned non-zero exit code: 1

But most telling:

Cannot find file ‘…/…/components/CheckList/CheckList’ in ‘./src/containers/Book’.

I am currently try whether or not adding the literal ‘.js’ to my imports is required by Netlify.
Update: that wasn’t the issue either

3 Likes

SOLVED:

Hi guys, I figured out the issue.
If you’re having the same problem, please check the actual Github repository. Name changes don’t propagate the same way. I had to manually rename files on Github itself :roll_eyes:

4 Likes

hey @Dylan1! thanks for posting your solution! Glad you figured it out!

Ah geez thats so dumb. I was wondering why netlify kept telling me It couldn’t find an import, and when I checked github, the folder name wasn’t changed…

Thanks for posting your solution!

Many thanks! That is crazy lol

I am getting “Cannot find file ‘./app’ in ‘./src’.” What does the letter case have to do with the error? I don’t get it

hey joe, can you post your full build log please?


Here the screenshot. It’s the same issue of not finding the file

Hey @JoeKabongo,
At first glance, this seems like a React issue and not a Netlify issue. Are you getting this error when you build locally as well or only when you deploy?

Either way, the letter case is significant… and git may not pick up if you have renamed your file to be uppercase or lowercase- you will have to rename your file to something unrelated, like temp, and then rename it back with the correct case, like App or Src. Let us know how it goes.

I was able to solve it. It had something to do with the file names

1 Like

I am getting the same issue, can you provide some more insight.

----LOG----

9:49:28 PM: Failed to compile.
9:49:28 PM: ./src/index.js
9:49:28 PM: Cannot find file ‘./App’ in ‘./src’.

Hey there, thanks for reaching out.

What you are describing sounds a bit like a an issue with case sensitivity on our system.

Can you give this a read through and let us know if that fixes the issue?