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 @gagan0723 https://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 ๋“ฑ๊ธ‰