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

"gatsby new" fails on eslint-loader #10620

Closed
bjpcjp opened this issue Dec 22, 2018 · 11 comments
Closed

"gatsby new" fails on eslint-loader #10620

bjpcjp opened this issue Dec 22, 2018 · 11 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs more info Needs triaging and reproducible examples or more information to be resolved

Comments

@bjpcjp
Copy link

bjpcjp commented Dec 22, 2018

Description

$gatsby new consistently fails to compile.

Steps to reproduce

$gatsby new home

Expected result

successful compilation

Actual result

Log from command line follows:

Module Error (from ./node_modules/eslint-loader/index.js):

/home/bjpcjp/projects/code/js/gatsby/home/src/components/image.js
  21:11  error  Cannot query field "childImageSharp" on type "File"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./src/pages/index.js 10:0-40 22:25-30
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

✖ 「wdm」: 
ERROR in ./src/components/image.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/bjpcjp/projects/code/js/gatsby/home/src/components/image.js
  21:11  error  Cannot query field "childImageSharp" on type "File"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./src/pages/index.js 10:0-40 22:25-30
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.

Environment

  System:
    OS: Linux 4.4 Ubuntu 14.04.5 LTS, Trusty Tahr
    CPU: (8) x64 Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
    Shell: 4.3.11 - /bin/bash
  Binaries:
    Node: 10.6.0 - ~/.nvm/versions/node/v10.6.0/bin/node
    Yarn: 1.10.1 - /usr/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.6.0/bin/npm
  Browsers:
    Firefox: 59.0
  npmPackages:
    gatsby: ^2.0.53 => 2.0.75 
    gatsby-image: ^2.0.20 => 2.0.25 
    gatsby-plugin-manifest: ^2.0.9 => 2.0.12 
    gatsby-plugin-offline: ^2.0.16 => 2.0.20 
    gatsby-plugin-react-helmet: ^3.0.2 => 3.0.5 
    gatsby-plugin-sharp: ^2.0.14 => 2.0.16 
    gatsby-source-filesystem: ^2.0.8 => 2.0.12 
    gatsby-transformer-sharp: ^2.1.8 => 2.1.9 
  npmGlobalPackages:
    gatsby-cli: 2.4.7

@LekoArts LekoArts added the status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. label Dec 22, 2018
@LekoArts LekoArts changed the title Compile failure "gatsby new" fails on eslint-loader Dec 22, 2018
@LekoArts
Copy link
Contributor

Hi!
So just to make sure how you encounter this issue:

  1. You go into a directory
  2. Do a gatsby new $name
  3. The above error occurs

Right?

@bjpcjp
Copy link
Author

bjpcjp commented Dec 22, 2018

Correct. I’m using an empty directory. Thank you!

@sidharthachatterjee
Copy link
Contributor

Thank you for opening this @bjpcjp

Looks related to #9511

gatsby-plugin-sharp uses node-gyp which according to https://github.com/nodejs/node-gyp needs:

  • python (v2.7 recommended, v3.x.x is not supported)

Can you check what version you have installed?

@sidharthachatterjee sidharthachatterjee added status: awaiting author response Additional information has been requested from the author and removed status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. labels Dec 24, 2018
@bjpcjp
Copy link
Author

bjpcjp commented Dec 24, 2018

Thanks @sidharthachatterjee - I'm using Python 3.6.5 via Anaconda.

@sidharthachatterjee
Copy link
Contributor

@bjpcjp That explains it

node-gyp doesn't support v3.x.x unfortunately

Can you please install and switch to v2.7 and try again?

@bjpcjp
Copy link
Author

bjpcjp commented Dec 24, 2018

Switched to Python 2.7.6 (Anaconda distro) and entered "$gatsby new homepy27" (empty directory).

Compilation again failed. Error log:

 ERROR  Failed to compile with 1 errors                                                                      11:32:58 AM
 error  in ./src/components/image.js

Module Error (from ./node_modules/eslint-loader/index.js):

/home/bjpcjp/projects/code/js/gatsby/homepy27/src/components/image.js
  21:11  error  Cannot query field "childImageSharp" on type "File"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)
 @ ./src/pages/index.js 10:0-40 22:25-30
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app

✖ 「wdm」: 
ERROR in ./src/components/image.js
Module Error (from ./node_modules/eslint-loader/index.js):

/home/bjpcjp/projects/code/js/gatsby/homepy27/src/components/image.js
  21:11  error  Cannot query field "childImageSharp" on type "File"  graphql/template-strings

✖ 1 problem (1 error, 0 warnings)

 @ ./src/pages/index.js 10:0-40 22:25-30
 @ ./.cache/sync-requires.js
 @ ./.cache/app.js
 @ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false ./.cache/app
ℹ 「wdm」: Failed to compile.

@sidharthachatterjee sidharthachatterjee added status: inkteam to review and removed status: awaiting author response Additional information has been requested from the author labels Dec 25, 2018
@brookslyrette
Copy link

Same issue on a fresh install. I'm also on python 2.7.

@pieh
Copy link
Contributor

pieh commented Dec 27, 2018

Can you paste full terminal output? There might be some clues earlier

@sidharthachatterjee
Copy link
Contributor

@bjpcjp @brookslyrette Can you check if 3 is the default? I have a feeling node is still calling 3. After switching to 2.7 in Anaconda, can you run ?

  • npm install --global gatsby-cli
  • gatsby new gatsby-site
  • cd gatsby-site
  • gatsby develop

@sidharthachatterjee sidharthachatterjee added status: needs more info Needs triaging and reproducible examples or more information to be resolved and removed status: inkteam to review labels Dec 27, 2018
DSchau pushed a commit that referenced this issue Dec 27, 2018
This adds Python to output of `gatsby info`

`gatsby-plugin-sharp` is very widely used and is included in the default starter. `sharp` uses `nodegyp` which needs `python` and according to its documentation

> v2.7 recommended, v3.x.x is not supported

We've seen several issues where building breaks due to `sharp` not working like #10620 and #9511

Knowing the python version in the env helps in these cases
@brookslyrette
Copy link

@siddharthkp Root cause is the same as #9511.

Installing the older version of plugin-manifest fixed it for now. #9511 (comment)

gpetrioli pushed a commit to gpetrioli/gatsby that referenced this issue Jan 22, 2019
This adds Python to output of `gatsby info`

`gatsby-plugin-sharp` is very widely used and is included in the default starter. `sharp` uses `nodegyp` which needs `python` and according to its documentation

> v2.7 recommended, v3.x.x is not supported

We've seen several issues where building breaks due to `sharp` not working like gatsbyjs#10620 and gatsbyjs#9511

Knowing the python version in the env helps in these cases
@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Feb 10, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 10, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@bjpcjp bjpcjp closed this as completed Feb 10, 2019
pieh pushed a commit that referenced this issue Mar 20, 2019
We've seen several issues where builds break because `gatsby-plugin-sharp` fails for some reason. 

Typically because `sharp` didn't build correctly during install like in #10620 most likely due to an incorrect version of python

From https://github.com/nodejs/node-gyp
> python (v2.7 recommended, v3.x.x is not supported)

This PR adds a try-catch around requiring `sharp` and bails early if it fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. status: needs more info Needs triaging and reproducible examples or more information to be resolved
Projects
None yet
Development

No branches or pull requests

5 participants