Gatsby: Error with hot reloading

Created on 22 Nov 2017  ·  3Comments  ·  Source: gatsbyjs/gatsby

Steps

  1. gatsby new tutorial-part-one https://github.com/gatsbyjs/gatsby-starter-hello-world
  2. cd tutorial-part-one && gatsby develop
  3. Initial view

first

  1. Edit index.js in src/pages/ and save the file.

react

  1. View after hot reload.

first

Expected behavior

Gatsby’s development server should hot reload in the browser and reflect changes made in src/pages/index.js. The view must be as below:

second

Actual behavior

No hot reloading in the browser.

Errors in console

error

For changes to get reflected the browser needs to be refreshed.

Most helpful comment

It works for me when I start the server with gatsby develop --host localhost. This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop.

All 3 comments

It works for me when I start the server with gatsby develop --host localhost. This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop.

@andreasgruenh Adding gatsby develop --host localhost will not expose development server to the network.

Hi @andreasgruenh @gagan0723 please see https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment-346126702 and https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment-346130796 and more recent comments. Looks like we should default to localhost on Mac as well to avoid these. For local network testing on Mac can do -H [machine_name].local, any of that help?

Was this page helpful?
0 / 5 - 0 ratings