Gatsby: `gatsby develop` not working after `gatsby deploy`

Created on 7 Nov 2019  路  7Comments  路  Source: gatsbyjs/gatsby

Description

I have deployed my gatsby blog by running gatsby deploy and using Netlify - you can see the live site here.

After doing that, I am not able to run gatsby develop again and always have the following error message on my CLI:

[email protected] develop C:\Users\tformosinhosanchez\Documents\_Programming\Tests\gatsby-tfs-starter
> 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! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\tformosinhosanchez\AppData\Roaming\npm-cache\_logs\2019-11-07T01_08_29_501Z-debug.logPS C:\Users\tformosinhosanchez\Documents\_Programming\Tests\gatsby-tfs-starter>

I am intrigued by the fact that I can't gatsby develop when the site in up and running and live.

Steps to reproduce

Useful links:

I have run:

  1. gatsby deploy on my Repo in order to prep the site to publish in Netlify;
  2. Publish the site on Netlify;
  3. Got back to my Repo and run gatsby develop

Expected result

I was expecting to have on my http://localhost:8000/ exactly the same thing as per my Live site

Actual result

The gatsby develop gave me the following message:

[email protected] develop C:\Users\tformosinhosanchez\Documents\_Programming\Tests\gatsby-tfs-starter
> 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! [email protected] develop: `gatsby develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     C:\Users\tformosinhosanchez\AppData\Roaming\npm-cache\_logs\2019-11-07T01_08_29_501Z-debug.logPS C:\Users\tformosinhosanchez\Documents\_Programming\Tests\gatsby-tfs-starter>

Any ideas on why this is happening?

Most helpful comment

I am going to close this issue as I got it to work by installing the new version of gatsby with yarn add gatsby being able to run gatsby develop

All 7 comments

Check your component code. Gatsby deploy shouldn't have anything to do with it.

Thank you @matowang, what do you mean by that?
The this that is strange though is that the same codebase is working fine live, but I don't seem to be able to have that in develop mode.

I am going to close this issue as I got it to work by installing the new version of gatsby with yarn add gatsby being able to run gatsby develop

The problem was that gatsby-cli was added to the dependencies. In most cases you don't need and shouldn't add the CLI to your project, gatsby is enough.

I am seeing the same issue, with a much older code base which has gatsby at 2.0.48. gatsby-cli is not in dependencies.

'm still seeing this with [email protected], the latest release at this time. I'm able to avoid the error by downgrading to v2.17.10, but I think that this issue is still relevant now.

Edit: just cleared my package-lock.json and reinstalled fresh, and it works 馃帀

I am going to close this issue as I got it to work by installing the new version of gatsby with yarn add gatsby being able to run gatsby develop

this worked for me too!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

totsteps picture totsteps  路  3Comments

kalinchernev picture kalinchernev  路  3Comments

andykais picture andykais  路  3Comments

ghost picture ghost  路  3Comments