【问题标题】:Eleventy server ERR_EMPTY_RESPONSE十一服务器 ERR_EMPTY_RESPONSE
【发布时间】:2021-04-09 01:21:25
【问题描述】:

我成功地运行了 Jekyll 和 Gatsby 网站,但是当我尝试 Eleventy 时,我遇到了问题。当我执行https://www.11ty.dev/docs/getting-started/ 中描述的快速入门过程时,它成功地给了我这个输出:

$ npx @11ty/eleventy --serve --port=8000
Writing _site/README/index.html from ./README.md.
Writing _site/index.html from ./index.html.
Wrote 2 files in 0.15 seconds (v0.11.1)
Watching…
[Browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:8000
    External: http://192.168.7.233:8000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://localhost:3001
 --------------------------------------
[Browsersync] Serving files from: _site

但是,当我导航到此处列出的任何访问 URL 时,浏览器选项卡只会旋转几分钟,然后显示“此页面无法正常工作。localhost 未发送任何数据。ERR_EMPTY_RESPONSE”。

我打开了编写的两个文件,并确认它们是正确的。

//_site/index.html
<!doctype html><html><head><title>Page title</title></head><body><p>Hi</p></body></html>
//_site/README/index.html
<!doctype html><html><head><title>Page title</title></head><body><p>Hi</p></body></html>

我试过 Chrome 和 Firefox。

我尝试使用 npx @11ty/eleventy --serve --port=8081 更改端口并导航到端口 8081 和其他几个端口。

我已经在 2019 款 MacBook Pro 和 2013 款 MacBook Pro 上尝试了所有这些,都使用了 iTerm2,得到了相同的结果。


更多信息。我尝试了另一个我以前从未尝试过的静态站点框架的快速入门说明:Wintersmith。当我使用浏览器在 localhost 上预览生成的站点时,也会发生同样的事情。浏览器选项卡会一直旋转,直到收到 ERR_EMPTY_RESPONSE。

然后我回到我现有的 Jekyll 站点之一,以防万一它在 localhost 上也有 ERR_EMPTY_RESPONSE。但是,当我运行 bundle exec jekyll serve 时,它会很好地显示在浏览器中。

【问题讨论】:

    标签: server terminal static-site npx eleventy


    【解决方案1】:

    我发现了问题。我的两台 MacBook 上的 ESET 病毒防护软件中的防火墙阻止了绑定到双冒号上未指定的 ipv6 地址的连接。 ::十一和温特史密斯这样做。杰基尔和盖茨比没有。

    https://forum.eset.com/topic/22080-mac-firewall-issue-after-update-to-684000/

    关闭 ESET 防火墙保护后,我就可以在浏览器中看到我的 Eleventy 和 Wintersmith 站点。

    【讨论】:

      猜你喜欢
      • 2021-11-07
      • 1970-01-01
      • 2018-02-05
      • 2018-07-20
      • 1970-01-01
      • 1970-01-01
      • 2017-10-11
      • 1970-01-01
      • 2017-07-06
      相关资源
      最近更新 更多