React Static Fresh 安装导致“Firefox 无法与 localhost:3000 的服务器建立连接”

问题描述

运行以下并选择所有认选项,但无法在浏览器中访问该应用。

react-static create

? What should we name this project? my-first-site
? Select a template below... typescript
Creating new react-static project...

然后我cd到新生成的项目目录并准备部署。

yarn start

我得到了一些不错的输出

yarn run v1.22.10
$ react-static start
Starting Development Server...
Fetching Site Data...
[✓] Site Data Downloaded
Building Routes...
Importing routes from directory...
{ has404: true }
[✓] Routes Built (0.1s)
Building Templates...
[✓] Templates Built
Bundling Application...
Fetching Site Data...
[✓] Site Data Downloaded (0.1s)
Running plugins...
[✓] Application Bundled (15.9s)
[✓] App serving at http://localhost:3000

然后失败:

image

使用 npm 而不是 yarn 来构建服务会在我的网络上启动该站点,但在本地主机上它仍然无法运行。

npm run build
npm run serve

image

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)