Gatsby: Kesalahan dengan memuat ulang panas

Dibuat pada 22 Nov 2017  ·  3Komentar  ·  Sumber: gatsbyjs/gatsby

Steps Langkah

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

first

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

react

  1. View after hot reload. Lihat setelah reload panas.

first

Expected behavior Perilaku yang diharapkan

Gatsby's development server should hot reload in the browser and reflect changes made in src/pages/index.js . Server pengembangan Gatsby harus memuat ulang di browser dan mencerminkan perubahan yang dibuat di src/pages/index.js . The view must be as below: Tampilannya harus seperti di bawah ini:

second

Actual behavior Perilaku sebenarnya

No hot reloading in the browser. Tidak ada reload panas di browser.

Errors in console Kesalahan di konsol

error

For changes to get reflected the browser needs to be refreshed. Agar perubahan tercermin, browser perlu di-refresh.

en

Komentar yang paling membantu

It works for me when I start the server with gatsby develop --host localhost . Ini berfungsi untuk saya ketika saya memulai server dengan gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Ini adalah perilaku yang tidak terduga atau harus ditambahkan ke semua tutorial yang menyebutkan memuat ulang panas dengan gatsby develop .

en

Semua 3 komentar

It works for me when I start the server with gatsby develop --host localhost . Ini berfungsi untuk saya ketika saya memulai server dengan gatsby develop --host localhost . This is either unexpected behavior or should be added to all tutorials that mention hot reloading with gatsby develop . Ini adalah perilaku yang tidak terduga atau harus ditambahkan ke semua tutorial yang menyebutkan memuat ulang panas dengan gatsby develop .

en

@andreasgruenh Menambahkan gatsby develop --host localhost tidak akan mengekspos server pengembangan ke jaringan.

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. Hai @andreasgruenh @gagan0723 silakan lihat https://github.com/gatsbyjs/gatsby/pull/2983#issuecomment -346126702 dan https://github.com/gatsbyjs/gatsby/issues/2960#issuecomment -346130796 dan komentar terbaru lainnya . Looks like we should default to localhost on Mac as well to avoid these. Sepertinya kita harus default ke localhost di Mac juga untuk menghindari ini. For local network testing on Mac can do -H [machine_name].local , any of that help? Untuk pengujian jaringan lokal di Mac dapat melakukan -H [machine_name].local , apakah ada yang membantu?

en
Apakah halaman ini membantu?
0 / 5 - 0 peringkat