我在这里看到了很多类似的问题,并且尝试了所有方法,但是我不知道为什么仍然不显示任何内容。
npm install react-app-polyfill
我在package.json的生产和开发数组中添加了“ ie 11”
添加此两行import "react-app-polyfill/ie11";
import "react-app-polyfill/stable";
到index.js
的顶部
删除node_modules内部的.cache文件夹
重新启动应用程序
但仍未在IE 11中显示任何内容。
这是我的package.json
{ "name": "firealarm", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.3.3", "@testing-library/user-event": "^7.1.2", "antd": "^3.26.2", "axios": "^0.19.0", "core-js": "^3.6.1", "cors": "^2.8.5", "jspdf": "^1.5.3", "jspdf-autotable": "^3.2.11", "react": "^16.12.0", "react-app-polyfill": "^1.0.5", "react-dom": "^16.12.0", "react-router-dom": "^5.1.2", "react-scripts": "3.3.0" }, "scripts": { "start": "set PORT=3006 && react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ "ie 11", ">0.2%", "not dead", "not op_mini all" ], "development": [ "ie 11", "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }
我什至删除了node_modules文件夹并再次安装
npm
,但仍然无法正常工作。更新
我在IE 11中收到两个错误消息。
SCRIPT5022: SyntaxError File: 0.chunk.js, Line: 176128, Column: 38
和
SCRIPT5022: The error you provided does not contain a stack trace. File: 0.chunk.js, Line: 205780, Column: 64
。
我在这里看到了很多类似的问题,并且尝试了所有方法,但是我不知道为什么仍然不显示任何内容。 npm install react-app-polyfill我在生产中添加了“ ie 11”,然后...