Fixing Netlify Build Fail - error #98123 WEBPACK

Netlify Build Failing: error #98123 WEBPACK

I ran into an annoying issue when relaunching this blog.

The strange thing was that yarn build would build Gatsby successfully locally (I'm on OSX) but the Netlify build would fail 🤦🏻‍♂️.

8:50:22 PM: info bootstrap finished - 5.699 s
8:50:22 PM: ERROR #98123  WEBPACK
8:50:41 PM: failed Building production JavaScript and CSS bundles - 18.625s
8:50:41 PM: error Generating JavaScript bundles failed
8:50:41 PM: Can't resolve '../components/Footer' in '/opt/build/repo/src/layout'
8:50:41 PM: not finished run queries - 18.730s
8:50:41 PM: error Command failed with exit code 1.

The Cause: Linux Case Sensitivity

It turns out the issue was because of a case difference in what some files were requiring and the name of the file.

The reason it was working locally, is that OSX will automatically resolve the issue, but the Netlify build server is Linux, and will fail.

The Fix: Set git config or Fix Imports

The fix that resolved the issue was to run the following command.

$ git config core.ignorecase false

Credit to user: <a href='' target='blank'>pedrouid on GitHub_