使用 npm 运行 build react app 后出现白屏

white screen after using npm run build react app

使用后

npm run build

构建已开发的部署应用程序,打开时显示白屏

build/index.html

当我设置主页时:“。”在 package.json.

控制台错误屏幕截图 enter image description here

我找到了一种方法 运行 这个项目有一个名为 serve

的 npm 包
serve -s build

这对我有用,而不是直接从 /build/index.html 打开文件