描述
我正在按照此处的说明进行操作:https://www.gatsbyjs.org/tutorial/part-one/,但是当我启动开发服务器并更改src/pages/index.js时,浏览器中未进行热重载。
重现步骤
使用gatsby-cli:
- gatsby new hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world
- cd hello-world
- gatsby develop
- 更改src/pages/index.js中的div内文本
期望结果
页面应自动重新加载新文本。
实际结果
除非在浏览器中手动刷新,否则页面不会更改。
规格
操作系统: 运行在Windows 10 Pro上的WSL Ubuntu 18.04.3 LTS
Node: 12.12.0
NPM: 6.11.3
Gatsby CLI: 2.8.8
Gatsby: 2.17.6
浏览器: Chrome 77.0.3865.120, IE 11.1006.17134.0, Firefox 70.0
我尝试了多个浏览器,但结果相同。因此,我在Firefox中运行了开发工具,并在进行更改时检查了控制台输出,发现以下错误:
The connection to http://localhost:8000/__webpack_hmr was interrupted while the page was loading. client.js:88
[HMR] Update check failed: hotDownloadManifest/</request.onreadystatechange@http://localhost:8000/commons.js:42:16
process-update.js:147
Error: Manifest request to /d528b21bff3fd2caa92d.hot-update.json timed out. bootstrap:41
Firefox can’t establish a connection to the server at http://localhost:8000/__webpack_hmr. client.js:88
我也在github和这里搜索了一下,但没有找到解决我的问题的办法。如果您有任何解决方法、建议或有关为什么这对我不起作用的见解,将不胜感激!