Static Create React App site build failing

Hi there. Following your guide (here: Deploy a Create React App Static Site | Render Docs) for the CRA site I am trying to deploy, but when the build runs (on Render only), we get the following error:

Nov 3 10:35:29 AM  $ react-scripts build
Nov 3 10:35:31 AM  Creating an optimized production build...
Nov 3 10:35:39 AM  Failed to compile.
Nov 3 10:35:39 AM  
Nov 3 10:35:39 AM  Module not found: Error: Can't resolve '../icons/IdentIcon' in '/opt/render/project/src/src/components/modals'
Nov 3 10:35:39 AM

Locally, I can run a production build with no failures (running the same CRA out-of-the-box yarn build command).

Where it is getting hung up appears to be in /opt/render/project/src/src/components/modals/AccountModal.tsx, which includes ‘…/icons/IdentIcon’ using a relative path.

Project folders are:

Is this a known issue? Any advice?

Thanks

Hi there,

This will be an issue with case sensitivity. Builds on Render are done on a Linux OS where all files and directory names are case-sensitive. When resolving modules, Node will use the OS-level file to see if the module exists. If a module doesn’t have the matching case as the file and path, it will fail to be found. This issue doesn’t appear on a Windows OS as files and directory names in Windows are not case-sensitive.

Regards,

Keith
Render Support, UTC+10 :australia:

Unfortunately not the case here - using MacOs locally, and the casing is correct. Will keep plugging away to see if I can find a cause.

It was indeed a case issue - MacOs, while displaying the correct case, the file itself was not as-included. A proper rename fixed it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.