Gatsby: Fehler beim Hot-Neuladen

Erstellt am 22. Nov. 2017  ·  3Kommentare  ·  Quelle: gatsbyjs/gatsby

Steps Schritte

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

first

  1. Edit index.js in src/pages/ and save the file. Bearbeiten Sie index.js in src/pages/ und speichern Sie die Datei.

react

  1. View after hot reload. Ansicht nach heißem Neuladen.

first

Expected behavior Erwartetes Verhalten

Gatsby's development server should hot reload in the browser and reflect changes made in src/pages/index.js . Der Entwicklungsserver von Gatsby sollte im Browser neu geladen werden und die in src/pages/index.js vorgenommenen Änderungen widerspiegeln. The view must be as below: Die Ansicht muss wie folgt sein:

second

Actual behavior Tatsächliches Verhalten

No hot reloading in the browser. Kein heißes Nachladen im Browser.

Errors in console Fehler in der Konsole

error

For changes to get reflected the browser needs to be refreshed. Damit die Änderungen übernommen werden, muss der Browser aktualisiert werden.

en

Hilfreichster Kommentar

It works for me when I start the server with gatsby develop --host localhost . Bei mir funktioniert es, wenn ich den Server mit gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Dies ist entweder ein unerwartetes Verhalten oder sollte allen Tutorials hinzugefügt werden, die das Hot Reloading mit gatsby develop erwähnen.

en

Alle 3 Kommentare

It works for me when I start the server with gatsby develop --host localhost . Bei mir funktioniert es, wenn ich den Server mit gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Dies ist entweder ein unerwartetes Verhalten oder sollte allen Tutorials hinzugefügt werden, die das Hot Reloading mit gatsby develop erwähnen.

en

@andreasgruenh Durch das Hinzufügen gatsby develop --host localhost wird der Entwicklungsserver nicht dem Netzwerk ausgesetzt.

en

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. Hallo @andreasgruenh @gagan0723 , siehe https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment -346126702 und https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment -346130796 und neuere Kommentare . Looks like we should default to localhost on Mac as well to avoid these. Sieht so aus, als sollten wir auch auf dem Mac standardmäßig localhost verwenden, um diese zu vermeiden. For local network testing on Mac can do -H [machine_name].local , any of that help? Für lokale Netzwerktests auf dem Mac kann -H [machine_name].local etwas davon helfen?

en
War diese Seite hilfreich?
0 / 5 - 0 Bewertungen

Verwandte Themen

andykais picture andykais  ·  3Kommentare

ferMartz picture ferMartz  ·  3Kommentare

theduke picture theduke  ·  3Kommentare

hobochild picture hobochild  ·  3Kommentare

jimfilippou picture jimfilippou  ·  3Kommentare