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

Cannot find gatsby-config.js #15565

Closed
lbittner-pdftron opened this issue Jul 9, 2019 · 10 comments
Closed

Cannot find gatsby-config.js #15565

lbittner-pdftron opened this issue Jul 9, 2019 · 10 comments
Labels
type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@lbittner-pdftron
Copy link

lbittner-pdftron commented Jul 9, 2019

Description

After upgrading from Gatsby@2.0.25 to Gatsby@2.13.9, running npm start throws the following error:

 ERROR #10123  CONFIG

We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.

  Error: C:\Users\Shreyans\Documents\pdftron-dev-site\node_modules\gatsby\dist\bootstrap\get-config-file.js:1

  Error: Cannot find module 'C:\\Users\\Shreyans\\Documents\\pdftron-dev-site\\node_modules\\gatsby-plugin-layout\\gatsby-config'

I have only been able to reproduce this issue on windows. I can confirm that these files do not exist (on both windows & mac), but mac seems to handle it gracefully.

I tried adding a fake gatsby-config.js to C:\\Users\\Shreyans\\Documents\\pdftron-dev-site\\node_modules\\gatsby-plugin-layout\\gatsby-config, and the error went away, but then the same error was thrown for a different plugin.

Expected result

Missing config files should be handled gracefully.

Actual result

They are not.

Environment

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Binaries:
npm: 6.10.0 - C:\Program Files\nodejs\npm.CMD
Languages:
Python: 2.7.16 - /c/Python27/python
Browsers:
Edge: 44.18362.1.0
npmPackages:
gatsby: 2.13.9 => 2.13.9
gatsby-link: ^2.0.4 => 2.2.0
gatsby-plugin-catch-links: 2.0.3 => 2.0.3
gatsby-plugin-google-analytics: 2.0.0-rc.2 => 2.0.0-rc.2
gatsby-plugin-layout: 1.1.0 => 1.1.0
gatsby-plugin-react-helmet: 3.0.0-rc.1 => 3.0.0-rc.1
gatsby-plugin-sass: 2.0.0-rc.2 => 2.0.0-rc.2
gatsby-remark-autolink-headers: 2.0.0-rc.2 => 2.0.0-rc.2
gatsby-remark-copy-linked-files: 2.0.0-rc.5 => 2.0.0-rc.5
gatsby-remark-external-links: 0.0.4 => 0.0.4
gatsby-source-filesystem: 2.0.1-rc.6 => 2.0.1-rc.6
gatsby-transformer-json: 2.1.1-rc.6 => 2.1.1-rc.6
gatsby-transformer-remark: 2.1.4 => 2.1.4

@dantehemerson dantehemerson added the type: question or discussion Issue discussing or asking a question about Gatsby label Jul 9, 2019
@dantehemerson
Copy link
Contributor

Try reinstall all packages, remove node_modules and package-lock.json or yarn.lock

@lbittner-pdftron
Copy link
Author

Hi @dantehemerson, we tried this on multiple machines with no luck :(

@ipatate
Copy link
Contributor

ipatate commented Jul 10, 2019

try gatsby clean ? or upgrade to 2.13.11 or more.

@moonmeister
Copy link
Contributor

I'd recommend updating your dependencies. Looks like most of these plugins are release candidates from the early days of Gatsby v2. I bet there are some compatibility issues.

@lbittner-pdftron
Copy link
Author

Thanks for the suggestions guys. We have updated all our dependencies to the following versions:

    gatsby: ^2.13.10 => 2.13.10
    gatsby-link: ^2.0.4 => 2.2.0
    gatsby-plugin-catch-links: 2.0.3 => 2.0.3
    gatsby-plugin-google-analytics: ^2.1.1 => 2.1.1
    gatsby-plugin-layout: ^1.1.0 => 1.1.0
    gatsby-plugin-react-helmet: ^3.1.0 => 3.1.0
    gatsby-plugin-sass: ^2.1.0 => 2.1.0
    gatsby-remark-autolink-headers: ^2.1.0 => 2.1.0
    gatsby-remark-copy-linked-files: ^2.1.0 => 2.1.0
    gatsby-remark-external-links: ^0.0.4 => 0.0.4
    gatsby-source-filesystem: ^2.1.2 => 2.1.2
    gatsby-transformer-json: ^2.2.0 => 2.2.0
    gatsby-transformer-remark: ^2.6.1 => 2.6.1

and still no luck.

@dantehemerson
Copy link
Contributor

Could you share a repo to reproduce the error?

@ipatate
Copy link
Contributor

ipatate commented Jul 11, 2019

this is what I will do :

  • create new project gatsby empty
  • add all plugin manually
  • copy gastby file ( gatsby config, gatsby-node...) from the broken project
  • copy src from the broken project
    and test.

@lbittner-pdftron
Copy link
Author

Trying to create a repo where I can reproduce the issue and cannot, so Im assuming it's probably repo dependant. Ill try @ipatate suggestion and close this ticket for now until I can find out some more info. Thanks for the help guys!

@wesbos
Copy link
Contributor

wesbos commented Sep 9, 2020

I know this was a year ago, but did anyone find the solution to this? Having the same error here: wesbos/master-gatsby#28

@nilsriga
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

6 participants