ReactDOM无法从单独的js文件中呈现任何内容

问题描述 投票:0回答:1

我使用“ npx create-react-app testreact”创建了一个React项目。从PC上的浏览器进行测试时,服务器返回空白页,而不是预期的单词-“ Learn React”。

这里发生了什么?如何解决?

Cmd顺序

  1. npx create-react-app testreact
  2. npm安装
  3. npm开始

环境信息nodejs:v13.2.0npm:6.13.1系统:18.04.1-Ubuntu反向代理服务器:nginx

代码信息回购:https://github.com/nautilusshell/testreact.git有一个名为“ node_modules”的文件夹,它是由“ npm install”创建的,我没有放入上面的仓库中,因为它太大了,不需要上传。

顺便说一下,实际上我什么都没改变

错误信息造访http://52.130.83.55/image_editing从浏览器我得到:enter image description here

状态等于404的.js文件全部位于http://52.130.83.55/static/js/xxx.js

例如,未找到http://52.130.83.55/static/js/bundle.js

Nginx Config回购:https://github.com/nautilusshell/nginx_config.git

node.js reactjs npm react-dom npm-start
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.