为什么 React 生产构建不能在浏览器上运行? [英] Why won't React production build run on the browser?
问题描述
我正在尝试使用 react 的构建工具构建我的 react 应用程序.当我尝试npm start"时,应用程序运行良好.
npm start
在
但是当我构建应用程序并尝试访问构建文件夹中的index.html"文件时,它不起作用并且我遇到了白色的空白屏幕.
npm 运行构建
这是index.html
<html lang="zh-cn"><头><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="快捷图标" href="/favicon.ico"><title>React App</title><link href="/static/css/main.9a0fe4f1.css" rel="样式表">头部><身体><noscript>您需要启用 JavaScript 才能运行此应用程序.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.46d8cd76.js"></script>