question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 17 gatsby won't start

See original GitHub issue

After upgrading to React 17, gatsby develop and gatsby clean does not run successfully

➜  schwayweb git:(master) ✗ npm start

> schwayweb@0.1.0 start /Users/Austin/Projects/schwayweb
> npm run develop


> schwayweb@0.1.0 develop /Users/Austin/Projects/schwayweb
> gatsby develop

The above error occurred in the <StoreStateProvider> component:
    in StoreStateProvider
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! schwayweb@0.1.0 develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the schwayweb@0.1.0 develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Austin/.npm/_logs/2020-10-21T17_47_27_007Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! schwayweb@0.1.0 start: `npm run develop`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the schwayweb@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Austin/.npm/_logs/2020-10-21T17_47_27_039Z-debug.log
➜  schwayweb git:(master) ✗ 
➜  schwayweb git:(master) ✗ gss
 M gatsby-config.js
 M package-lock.json
 M package.json
➜  schwayweb git:(master) ✗ git diff
➜  schwayweb git:(master) ✗ 
➜  schwayweb git:(master) ✗ gss
 M gatsby-config.js
 M package-lock.json
 M package.json
➜  schwayweb git:(master) ✗ npm run clean

> schwayweb@0.1.0 clean /Users/Austin/Projects/schwayweb
> gatsby clean

The above error occurred in the <StoreStateProvider> component:
    in StoreStateProvider
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! schwayweb@0.1.0 clean: `gatsby clean`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the schwayweb@0.1.0 clean script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Environment

> schwayweb@0.1.0 info /Users/Austin/Projects/schwayweb
> gatsby info --clipboard

The above error occurred in the <StoreStateProvider> component:
    in StoreStateProvider
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! schwayweb@0.1.0 info: `gatsby info --clipboard`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the schwayweb@0.1.0 info script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Austin/.npm/_logs/2020-10-21T18_11_00_179Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/Austin/.nvm/versions/node/v12.19.0/bin/node',
1 verbose cli   '/Users/Austin/.nvm/versions/node/v12.19.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'info'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v12.19.0
4 verbose run-script [ 'preinfo', 'info', 'postinfo' ]
5 info lifecycle schwayweb@0.1.0~preinfo: schwayweb@0.1.0
6 info lifecycle schwayweb@0.1.0~info: schwayweb@0.1.0
7 verbose lifecycle schwayweb@0.1.0~info: unsafe-perm in lifecycle true
8 verbose lifecycle schwayweb@0.1.0~info: PATH: /Users/Austin/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Austin/Projects/schwayweb/node_modules/.bin:/Users/Austin/.nvm/versions/node/v12.19.0/bin:/Users/Austin/google-cloud-sdk/bin:/Users/Austin/.cargo/bin:/Users/Austin/.rbenv/shims:/Users/Austin/.rbenv/bin:/Users/austin/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/Austin/.rvm/bin
9 verbose lifecycle schwayweb@0.1.0~info: CWD: /Users/Austin/Projects/schwayweb
10 silly lifecycle schwayweb@0.1.0~info: Args: [ '-c', 'gatsby info --clipboard' ]
11 silly lifecycle schwayweb@0.1.0~info: Returned: code: 1  signal: null
12 info lifecycle schwayweb@0.1.0~info: Failed to exec info script
13 verbose stack Error: schwayweb@0.1.0 info: `gatsby info --clipboard`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/Austin/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/Users/Austin/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid schwayweb@0.1.0
15 verbose cwd /Users/Austin/Projects/schwayweb
16 verbose Darwin 19.6.0
17 verbose argv "/Users/Austin/.nvm/versions/node/v12.19.0/bin/node" "/Users/Austin/.nvm/versions/node/v12.19.0/bin/npm" "run" "info"
18 verbose node v12.19.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error schwayweb@0.1.0 info: `gatsby info --clipboard`
22 error Exit status 1
23 error Failed at the schwayweb@0.1.0 info script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

npm version: 6.14.8 node version: 12.19.0 gatsby version: 2.24.84

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:15
  • Comments:23 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
piehcommented, Oct 26, 2020

Updates ( https://github.com/gatsbyjs/gatsby/pull/27057 and https://github.com/gatsbyjs/gatsby/pull/27058) were released:

  • gatsby-cli@2.12.113
  • gatsby-recipes@0.2.34
  • gatsby@2.24.87 ( this part You’d need to update ).

If you used gatsby@ink-compiled - you should be able to use stable / latest now again (starting with gatsby@2.24.87)

7reactions
ivantusnolobovcommented, Oct 22, 2020

@wardpeet A way to reproduce

OS: macos catalina 10.15.7 Node: v14.8.0 NPM: 6.14.8

gatsby new gatsby-site https://github.com/gatsbyjs/gatsby-starter-hello-world
cd gatsby-site

update versions in package.json

 gatsby     ^2.24.79  →  ^2.24.85   
 react      ^16.12.0  →   ^17.0.1   
 react-dom  ^16.12.0  →   ^17.0.1  

remove package-lock.json and node_modules

rm -rf package-lock.json node_modules

clean install

npm i && npm run start

the error

The above error occurred in the <StoreStateProvider> component:
    in StoreStateProvider
    in App

React will try to recreate this component tree from scratch using the error boundary you provided, App.
Warning: App: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Common Errors - Gatsby
As you encounter errors while developing with Gatsby, it is likely you'll run into something that other users have already stumbled upon.
Read more >
Node.js 17.0.1 Gatsby error - "digital envelope routines
This issue comes with the new update of Node.js 17. In React you can change the script attribute in the package.json file to:...
Read more >
Gatsby v4 - npm
Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.
Read more >
Create a New React App
Create React App is a comfortable environment for learning React, and is the best way to start building a new single-page application in...
Read more >
22 - React Blog Website with Gatsby.js & Sanity.io - YouTube
TechHub-blog is a complete tech blog website. Here we will see three post types: blogs, categories, and authors. We will create relations ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found