When running gatsby develop
on a custom preview instance (on Heroku in this case), it fails with:
Error: The result of this StaticQuery could not be fetched.
This approach is recommended in the Gatsby docs on how to run a custom preview instance on Heroku.
- Clone this repo and jump in:
git clone https://github.com/woodwoerk/heroku-gatsby-dev-bug-repro.git
cd heroku-gatsby-dev-bug-repro
- Create a new Heroku site via the heroku cli:
heroku create
- Set Heroku env variables:
heroku config:set NODE_ENV=development
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set ENABLE_GATSBY_REFRESH_ENDPOINT=true
- Deploy to Heroku:
git push heroku master
- After deployment, open the app url which is now running
gatsby develop
at <heroku-app-name>.herokuapp.com