JS bundle failure

Hi, Im getting errors when trying to deploy a gatsbyjs site.

2:58:25 PM: Can't resolve '../components/Layout' in '/opt/build/repo/src/pages'`Preformatted text`
2:58:25 PM: error Generating JavaScript bundles failed
2:58:25 PM: Can't resolve '../components/Layout' in '/opt/build/repo/src/pages'
2:58:25 PM: error Generating JavaScript bundles failed
2:58:25 PM: Can't resolve '../components/Seo' in '/opt/build/repo/src/pages'
2:58:25 PM: error Generating JavaScript bundles failed
2:58:25 PM: Can't resolve '../components/Seo' in '/opt/build/repo/src/pages'

I’ve checked my local repo and github, the naming convention on my components match locally.

Please let me kow what im doing wrong.

Thank you.

can you verify that it builds locally?

if yes, but fails when you try and deploy on Netlify, this might be the culprit:

Thanks @perry

It is finelocally:
Screenshot 2020-04-10 at 17.47.16

Screenshot 2020-04-10 at 17.47.47

Sometimes git mixes up uppercase and lowercase file names. This can lead to errors like this.

Try to rename components/Seo to components/SeoComponent, update the imports, try the build locally to verify and then commit to git. Do the same with /components/Layout. This should “flush out” the uppercase/lowercase issue if it is the root cause here.

After this, you should be able to rename your components to whatever you wish :smiley:

In the image https://aws1.discourse-cdn.com/netlify/original/2X/9/9ab7e903c1d4900a0b87ca62e34972667c63fa01.png I see the lowercase imports components/seo vs components/Seo which makes me think this IS the issue

Thanks @DavidWells and @perry I’ve changed the github config file globally to ignore CaseSensitive, it worked. Thank you

2 Likes