如何解决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
然后失败:
使用 npm 而不是 yarn 来构建服务会在我的网络上启动该站点,但在本地主机上它仍然无法运行。
npm run build
npm run serve
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。