Errors uploading react app to cloudflare pages

I’m getting the following errors when I try to upload my app to Cloudflare pages. I can’t seem to resolve the issue myself. Can anyone point me in the right direction?

17:52:29.641 Module not found: Error: Can’t resolve ‘./components/TopMenu’ in ‘/opt/buildhome/repo/src’
17:52:29.642
17:52:29.642
17:52:29.664 npm ERR! code ELIFECYCLE
17:52:29.664 npm ERR! errno 1
17:52:29.665 npm ERR! [email protected] build: react-scripts build
17:52:29.666 npm ERR! Exit status 1
17:52:29.666 npm ERR!
17:52:29.666 npm ERR! Failed at the [email protected] build script.
17:52:29.666 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
17:52:29.680
17:52:29.680 npm ERR! A complete log of this run can be found in:
17:52:29.681 npm ERR! /opt/buildhome/.npm/_logs/2022-05-20T05_52_29_665Z-debug.log
17:52:29.691 Failed: build command exited with code: 1

May I ask if you are using Gatsby, and if you initially developed this on a Mac?

If yes, what version are you locally using of:

  • Gatsby
  • Node