Giter Site home page Giter Site logo

Comments (8)

coreyward avatar coreyward commented on August 17, 2024 3

I've not noticed this happening as much since I filed this bug originally. If it's been overnight or longer, or if my computer goes to sleep, it's more likely, but that's not a dealbreaker for me.

One thing that you can do to get the listener working again (and refresh your content) without restarting your dev server is to enable the refresh endpoint in Gatsby and then send a POST request to it. To enable the endpoint you just set an environment variable named ENABLE_GATSBY_REFRESH_ENDPOINT to a truthy value. I do this in .env, but you can do the same running from the command line:

ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop

Once you do this, restart Gatsby and proceed like normal. When you notice your content isn't reloading, or if you want to pull fresh data from other non-live sources, send a POST request to http://localhost:8000/__refresh. I like to set this up in my package.json scripts for convenience:

"scripts": {
  "develop": "ENABLE_GATSBY_REFRESH_ENDPOINT=true gatsby develop",
  "refresh": "curl -X POST http://localhost:8000/__refresh"
}

Then you can just run yarn refresh (or npm run refresh) to get fresh content and re-enable the Sanity listener.

from gatsby-source-sanity.

dylanjha avatar dylanjha commented on August 17, 2024

I'm seeing the same thing. @coreyward is this a new issue for you or has it always happened?

from gatsby-source-sanity.

coreyward avatar coreyward commented on August 17, 2024

@dylanjha It's been an issue since I turned on watchMode on November 22nd.

from gatsby-source-sanity.

fanniegunton avatar fanniegunton commented on August 17, 2024

Seeing the same issue using the sanity-gatsby-blog starter.

from gatsby-source-sanity.

roffelsaurus avatar roffelsaurus commented on August 17, 2024

Also experiencing this. Both myself on localhost and our content editors previewing stuff with gatsby develop -H 0.0.0.0 on heroku. I have also turned off overlayDrafts.

from gatsby-source-sanity.

MantasMikal avatar MantasMikal commented on August 17, 2024

I have the same issue

from gatsby-source-sanity.

j0hnm4r5 avatar j0hnm4r5 commented on August 17, 2024

Confirming this is still happening on 1.150.

from gatsby-source-sanity.

bryangruneberg avatar bryangruneberg commented on August 17, 2024

Thanks @coreyward - that's helpful!

from gatsby-source-sanity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.