Cannot find file...' error when building, case sensitive issue

I’ve got a basic, bare bones typescript create-react-app that I’m trying to deploy to Netlify via Github commits.

  • Deploying manually by running yarn build and then manually deploying using netlify deploy works fine
  • Linking the site to github though gives me a failure with the culprit message showing as:
Cannot find file './pages/Login' in './src'.

The file exists so I suspect that this has something to do with the file being typescript rather than javascript. Am I on the right track? Have I missed a clear gotcha when linking a typescript create-react-app to Netlify via Github?

Thanks in advance!

Fixed. I did it by renaming the file from Login to LoginPage. I have no idea what was broken or why this worked as a fix. I no longer think it is related to typescript.

My unconfirmed suspicion is that it is Git related wherein the Login file was once called login - with the capitalisation throwing off the build process. So changing the filename entirely solved this.

Hope this helps someone from frustration!

Note - I would like to change the title to reflect the issue and mark it as solved, but can’t find how to do this. Can anyone direct me on how?

hi hemal, thanks for posting your solution. Can you see a pencil next to the title of your post :thinking: you should be able to use that to edit. If not, please post the desired title and i will change - thanks for thinking of this. It helps make content easier to find for others :partying_face:

I’ve tried that but I get a screen showing this rather than a way to edit the title:

Am I clicking the wrong pencil icon? I can’t see any other though.

ah! it’s probably because you haven’t posted enough and only just joined! I will double check on those settings :thinking:

for now just let me know the title you’d like to change to, and i will edit :muscle:

thanks again!

Apologies I thought I had replied to this.

And edit to read:

'Cannot find file...' error when building. [SOLVED]


I’m also putting this here for anyone who comes across this thread: