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

default gatsby project does not compile #3467

Closed
hedgenet opened this issue Jan 10, 2018 · 15 comments
Closed

default gatsby project does not compile #3467

hedgenet opened this issue Jan 10, 2018 · 15 comments

Comments

@hedgenet
Copy link

hedgenet commented Jan 10, 2018

Description

Upon creating a new project with gatsby new myproject, the gatsby develop command fails with an error

Environment

Gatsby version:[email protected] + [email protected]
Node.js version:9.4.0
Operating System: Ubuntu 16.04.3 LTS

Actual result

gatsby develop fails with the following error:

ERROR Failed to compile with 1 errors
This relative module was not found:

  • ./index.css in ./src/layouts/index.js

Expected behavior

The project should compile and be accessible through the browser on localhost

Steps to reproduce

In a fresh node environment:

  1. npm install -g gatsby
  2. gatsby new myproject
  3. cd myproject
  4. gatsby develop
@KyleAMathews
Copy link
Contributor

Did you install globally gatsby-cli or gatsby? gatsby-cli is what you want. I'm also not 100% sure if Node 9 is working. I haven't tested that just yet and have heard of other people that had problems.

I just ran gatsby new newproject and it worked as expected.

@wbprice
Copy link

wbprice commented Jan 11, 2018

I'm having the same problem scaffolding a project after installing gatsby-cli on Fedora 26, using Node 8.5.

@hedgenet
Copy link
Author

@KyleAMathews I created a new node environment and did the following

npm install -g gatsby-cli
gatsby new newproject
cd newproject
gatsby develop

and I still got the same error.

You mention a potential problem with node 9, but I did use node version 9.3.0 last week successfully and just retested it ,using nodeenv, to be sure and I still have the error.

For the sake of completeness I have tested both gatsby-starter-hello-world and gatsby-starter-blog and they both work fine.

@wbprice you might want to get going with gatsby-starter-hello-world since it works.

Thx guys

@KyleAMathews
Copy link
Contributor

Another issue on this https://github.com/gatsbyjs/gatsby-starter-default/issues/41

I think it was this PR yesterday #3283 upgrading style-loader

I just reverted it and released a new version of Gatsby — could people here try upgrading to the latest version of Gatsby and see if things work now?

@hedgenet
Copy link
Author

I created a fresh environment with the latest installable version of gatsby 1.9.153. I executed the same cmds as before.

Unfortunately, the issue still appear to be there.

@hedgenet
Copy link
Author

This issue is now fixed for me with version 1.9.55.

Good Work.

@Hillsie
Copy link
Contributor

Hillsie commented Jun 26, 2018

This problem seems to have reared it's head again in 2.0.0-beta.1

ERROR Failed to compile with 1 errors

error in ./src/layouts/index.css

Module build failed: BrowserslistError: Unknown browser query dead

@Hillsie
Copy link
Contributor

Hillsie commented Jun 26, 2018

Yip, just ran with version [email protected] and it has no problems.

@m-allanson
Copy link
Contributor

Can you try with [email protected]? Note that you'll also need to install the v2 version of the starter you're using. See the instructions for official starters.

@natesjacobs
Copy link

I'm having the same issue. working with [email protected] and getting:
BrowserslistError: Unknown browser query dead``

if I used a v1 starter, do I need to do anything to "upgrade" to v2? what's the difference bw v1 and v2 starters?

Thanks!!!

@jeanlucaslima
Copy link

Can confirm it happens with beta2.0.0-beta.11, on a brand new project, follows log:

Windows: 10
Node: v9.3.0

F:\code>gatsby new project-test
info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-default.git
Cloning into 'project-test'...
remote: Counting objects: 804, done.
Receiving objects: 100% (804/804), 694.54 KiB | 363.00 KiB/s, done.eiving objects:  94% (756/804), 692.00 KiB | 360.00 KiB/s

Resolving deltas: 100% (469/469), done.
success Created starter directory layout
info Installing packages...
yarn install v1.2.1
warning You are using Node "9.3.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || ^8.0.0"
info No lockfile found.
[1/4] Resolving packages...
warning gatsby > [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
warning gatsby > [email protected]: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "[email protected]" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning "[email protected]" has unmet peer dependency "caniuse-db@^1.0.30000652".
warning "[email protected]" has unmet peer dependency "react@>=15.0.0".
warning "[email protected]" has unmet peer dependency "react@^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 32.48s.

F:\code>cd project-test

F:\code\project-test>gatsby develop
success delete html and css files from previous builds — 0.010 s
success open and validate gatsby-config — 0.008 s
success copy gatsby files — 0.019 s
success onPreBootstrap — 0.034 s
success source and transform nodes — 0.032 s
success building schema — 0.176 s
success createLayouts — 0.053 s
success createPages — 0.001 s
success createPagesStatefully — 0.051 s
success onPreExtractQueries — 0.001 s
success update schema — 0.146 s
success extract queries from components — 0.097 s
success run graphql queries — 0.047 s
success write out page data — 0.010 s
success write out redirect data — 0.002 s
success onPostBootstrap — 0.002 s

info bootstrap finished - 3.737 s

 ERROR  Failed to compile with 1 errors                                                                                                                                                                                                                                       23:40:07

 error  in ./src/layouts/index.css

Module build failed: BrowserslistError: Unknown browser query `dead`
    at error (F:\code\project-test\node_modules\browserslist\index.js:37:11)
    at F:\code\project-test\node_modules\browserslist\index.js:222:9
    at Array.forEach (<anonymous>)
    at browserslist (F:\code\project-test\node_modules\browserslist\index.js:196:13)
    at isSupported (F:\code\project-test\node_modules\caniuse-api\dist\index.js:65:37)
    at F:\code\project-test\node_modules\postcss-cssnext\lib\index.js:69:117
    at Array.forEach (<anonymous>)
    at F:\code\project-test\node_modules\postcss-cssnext\lib\index.js:56:35
    at creator (F:\code\project-test\node_modules\postcss\lib\postcss.js:150:35)
    at Object.postcss (F:\code\project-test\node_modules\gatsby\dist\utils\webpack.config.js:162:109)
    at Object.module.exports (F:\code\project-test\node_modules\postcss-loader\index.js:42:27)

 @ ./src/layouts/index.css 4:14-120 13:2-17:4 14:20-126

node --version
F:\code\project-test>node --version
v9.3.0

F:\code\project-test>gatsby --version
2.0.0-beta.11

@ilyaigpetrov
Copy link

Confirm with gatsby --version = 2.0.0-beta.5.
@jeanlucaslima 2.0.0-beta.11 isn't even published (see npm show gatsby-cli versions).

@m-allanson
Copy link
Contributor

See #6426

@kprentiss
Copy link

still on version 2.4.1

@isramv
Copy link

isramv commented Oct 4, 2018

Updating gatsby-cli to 2.4.2 fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants