Gatsby: ホットリロードのエラー

作成日 2017年11月22日  ·  3コメント  ·  ソース: 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. src/pages/index.jsを編集し、ファイルを保存します。

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 . Gatsbyの開発サーバーは、ブラウザでホットリロードし、 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.変更を反映するには、ブラウザを更新する必要があります。

en

最も参考になるコメント

It works for me when I start the server with gatsby develop --host localhost . gatsby develop --host localhostでサーバーを起動すると、うまくいきます。 This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop .これは予期しない動作であるか、 gatsby developを使用したホットリロードについて言及しているすべてのチュートリアルに追加する必要があります。

en

全てのコメント3件

It works for me when I start the server with gatsby develop --host localhost . gatsby develop --host localhostでサーバーを起動すると、うまくいきます。 This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop .これは予期しない動作であるか、 gatsby developを使用したホットリロードについて言及しているすべてのチュートリアルに追加する必要があります。

en

@andreasgruenh gatsby develop --host localhostを追加しても、開発サーバーはネットワークに公開されません。

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.こんにちは@ andreasgruenh @gagan0723https ://github.com/gatsbyjs/gatsby/pull/2983#issuecomment-346126702およびhttps://github.com/gatsbyjs/gatsby/issues/2960#issuecomment-346130796および最近のコメントを参照してください Looks like we should default to localhost on Mac as well to avoid these.これらを回避するために、Macでもデフォルトでlocalhostに設定する必要があるようです。 For local network testing on Mac can do -H [machine_name].local , any of that help? Macでのローカルネットワークテストの場合、 -H [machine_name].localを実行できますが、その助けはありますか?

en
このページは役に立ちましたか?
0 / 5 - 0 評価

関連する問題

theduke picture theduke  ·  3コメント

KyleAMathews picture KyleAMathews  ·  3コメント

jaanhio picture jaanhio  ·  3コメント

ghost picture ghost  ·  3コメント

benstr picture benstr  ·  3コメント