Gatsby: Erreur lors du rechargement à chaud

Créé le 22 nov. 2017  ·  3Commentaires  ·  Source: gatsbyjs/gatsby

Steps Pas

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

first

  1. Edit index.js in src/pages/ and save the file. Modifiez index.js dans src/pages/ et enregistrez le fichier.

react

  1. View after hot reload. Voir après le rechargement à chaud.

first

Expected behavior Comportement attendu

Gatsby's development server should hot reload in the browser and reflect changes made in src/pages/index.js . Le serveur de développement de Gatsby devrait se recharger à chaud dans le navigateur et refléter les modifications apportées dans src/pages/index.js . The view must be as below: La vue doit être comme ci-dessous :

second

Actual behavior Comportement réel

No hot reloading in the browser. Pas de rechargement à chaud dans le navigateur.

Errors in console Erreurs dans la console

error

For changes to get reflected the browser needs to be refreshed. Pour que les modifications soient prises en compte, le navigateur doit être actualisé.

en

Commentaire le plus utile

It works for me when I start the server with gatsby develop --host localhost . Cela fonctionne pour moi lorsque je démarre le serveur avec gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Il s'agit soit d'un comportement inattendu, soit d'un comportement à ajouter à tous les didacticiels mentionnant le rechargement à chaud avec gatsby develop .

en

Tous les 3 commentaires

It works for me when I start the server with gatsby develop --host localhost . Cela fonctionne pour moi lorsque je démarre le serveur avec gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Il s'agit soit d'un comportement inattendu, soit d'un comportement à ajouter à tous les didacticiels mentionnant le rechargement à chaud avec gatsby develop .

en

@andreasgruenh L'ajout gatsby develop --host localhost n'exposera pas le serveur de développement au réseau.

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. Salut @andreasgruenh @gagan0723 s'il vous plaît voir https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment -346126702 et https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment -346130796 et des commentaires plus récents . Looks like we should default to localhost on Mac as well to avoid these. Il semble que nous devrions également utiliser par défaut localhost sur Mac pour les éviter. For local network testing on Mac can do -H [machine_name].local , any of that help? Pour les tests de réseau local sur Mac, vous pouvez faire -H [machine_name].local , cela vous aide-t-il ?

en
Cette page vous a été utile?
0 / 5 - 0 notes