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://global.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

3 Likes

If you don’t mind, can you share how you changed your git config to ignore case sensitivity?

Hi, @technoken35, we don’t have more information about how @linards resolved this. Our support team’s recommendation is to correct the site code to match the case of the actual files.

Maybe @linards will share his solution but our solution will also work if you want to try it.

If there are any questions about how to do this, please let us know.