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.
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.