Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Build breaking on Netlify #8205

Closed
merelinguist opened this issue Sep 16, 2018 · 5 comments

Comments

@merelinguist
Copy link
Contributor

@merelinguist merelinguist commented Sep 16, 2018

Description

Build works locally, but fails on Netlify.

Steps to reproduce

Project is here: merelinguist/playhouse-press#225

Expected result

I would expect it to build normally.

Actual result

Build works fine locally, but breaks on Netlify:

error Generating JavaScript bundles failed

  Error: ./src/components/Page/index.js
  Module not found: Error: Can't resolve '../Footer' in '/opt/build/repo/src/com  ponents/Page'
  resolve '../Footer' in '/opt/build/repo/src/components/Page'
    using description file: /opt/build/repo/package.json (relative path: ./src/c  omponents/Page)
      Field 'browser' doesn't contain a valid alias configuration
      using description file: /opt/build/repo/package.json (relative path: ./src  /components/Footer)
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/Footer doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/Footer.js doesn't exist
        .jsx
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/Footer.jsx doesn't exist
        as directory
          /opt/build/repo/src/components/Footer doesn't exist
  [/opt/build/repo/src/components/Footer]
  [/opt/build/repo/src/components/Footer.js]
  [/opt/build/repo/src/components/Footer.jsx]
   @ ./src/components/Page/index.js 8:0-31 69:29-35
   @ ./src/templates/post.js
   @ ./.cache/async-requires.js
   @ ./.cache/production-app.js


  Error: ./src/templates/post.js
  Module not found: Error: Can't resolve '../components/PostView' in '/opt/build  /repo/src/templates'
  resolve '../components/PostView' in '/opt/build/repo/src/templates'
    using description file: /opt/build/repo/package.json (relative path: ./src/t  emplates)
      Field 'browser' doesn't contain a valid alias configuration
      using description file: /opt/build/repo/package.json (relative path: ./src  /components/PostView)
        no extension
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/PostView doesn't exist
        .js
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/PostView.js doesn't exist
        .jsx
          Field 'browser' doesn't contain a valid alias configuration
          /opt/build/repo/src/components/PostView.jsx doesn't exist
        as directory
          /opt/build/repo/src/components/PostView doesn't exist
  [/opt/build/repo/src/components/PostView]
  [/opt/build/repo/src/components/PostView.js]
  [/opt/build/repo/src/components/PostView.jsx]
   @ ./src/templates/post.js 5:0-46 16:26-34
   @ ./.cache/async-requires.js
   @ ./.cache/production-app.js

Environment

  System:
    OS: macOS High Sierra 10.13.6
    CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.10.0 - ~/.nvm/versions/node/v10.10.0/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.10.0/bin/npm
  Browsers:
    Safari: 11.1.2
  npmPackages:
    gatsby: ^2.0.0-rc.25 => 2.0.0-rc.25 
    gatsby-plugin-react-helmet: ^3.0.0-rc.1 => 3.0.0-rc.1 
    gatsby-plugin-styled-components: ^3.0.0-rc.5 => 3.0.0-rc.5 
    gatsby-source-filesystem: ^2.0.1-rc.6 => 2.0.1-rc.6 
    gatsby-transformer-remark: ^2.1.1-rc.5 => 2.1.1-rc.5 
@KyleAMathews

This comment has been minimized.

Copy link
Contributor

@KyleAMathews KyleAMathews commented Sep 16, 2018

This is because you have a case difference in what you're requiring and the name of the file. This works in Macs and doesn't for Linux.

@pedrouid

This comment has been minimized.

Copy link
Member

@pedrouid pedrouid commented Dec 6, 2018

I was also riding in circles around this same issue.

This solved it for me:

git config core.ignorecase false

I've never had issue with case-senstive file name changes.
Either it was just a coincidence or this is part of the Gatsby v2 Starter??

andrashari pushed a commit to andrashari/netlfy-cms that referenced this issue Jan 13, 2019
@ettaibi

This comment has been minimized.

Copy link

@ettaibi ettaibi commented Jan 17, 2019

how to resolve this while pushing to a docker container ?

@Alfrex92

This comment has been minimized.

Copy link

@Alfrex92 Alfrex92 commented Mar 2, 2019

I had the same problem, I fixed by manually changing the imports.

Before:
import Features from "../components/features/features";
After:
import Features from "../components/features/Features";

Credits to talves on StackOverFlow

@GlynL

This comment has been minimized.

Copy link

@GlynL GlynL commented Mar 28, 2019

Just ran into the same mistake. Shouldn't this be something that produces an error in development?

SeanKilleen added a commit to SeanKilleen/BeABetterMan.online that referenced this issue Jun 24, 2019
so that it will work on netlify. gatsbyjs/gatsby#8205
KarstenBuckstegge added a commit to KarstenBuckstegge/karstenbuckstegge-gatsby that referenced this issue Oct 7, 2019
by adding case sensitivity config to git
gatsbyjs/gatsby#8205
lvlzeros added a commit to lvlzeros/lvlzeros.github.io that referenced this issue Oct 13, 2019
Used ```git config core.ignorecase false```

Ref: gatsbyjs/gatsby#8205
KnightRadiant pushed a commit to KnightRadiant/my-blog that referenced this issue Nov 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.