微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

React App无法在Microsoft Edge浏览器上运行,但在Chrome和Firefox上可以正常运行

该应用程序在chrome和firefox上运行良好,但在Edge上无法运行。这是我的package.json。我正在使用create-react-app。

{
"version": "0.1.0","private": true,"dependencies": {
    "@hookform/resolvers": "^0.1.1","@testing-library/jest-dom": "^4.2.4","@testing-library/react": "^9.5.0","@testing-library/user-event": "^7.2.1","axios": "^0.19.2","core-js": "^3.6.5","joi": "^17.2.1","jquery": "^3.5.1","little-state-machine": "^3.0.3","little-state-machine-devtools": "^1.0.0","moment": "^2.27.0","react": "^16.13.1","react-app-polyfill": "^1.0.6","react-dom": "^16.13.1","react-google-autocomplete": "^1.2.6","react-google-maps": "^9.4.5","react-hook-form": "^6.0.8","react-router-dom": "^5.2.0","react-scripts": "3.4.1","react-spring": "^8.0.27","react-stepzilla": "^6.0.2","react-table": "^7.5.0","react-to-print": "^2.9.0","react-toastify": "^6.0.8","recoil": "0.0.10","underscore": "^1.10.2","yup": "^0.29.2"
},"scripts": {
    "start": "react-scripts start","build": "react-scripts build","test": "react-scripts test","eject": "react-scripts eject"
},"eslintConfig": {
    "extends": "react-app"
},"browserslist": {
    "production": [
        ">0.2%","not dead","not op_mini all"
    ],"development": [
        "last 1 chrome version","last 1 firefox version","last 1 safari version"
    ]
}

}

我在Edge中遇到此错误

SCRIPT1028:SCRIPT1028:预期的标识符,字符串或数字。在1.chunk.js

它指向以下代码的第二行。带有传播算子的那个。

function setUnvalidatedAtomValue(state,key,newValue) {
  return { ...state,atomValues: mapByDeletingFromMap$1(state.atomValues,key),nonvalidatedAtoms: mapBySettingInMap$1(state.nonvalidatedAtoms,newValue),dirtyAtoms: setByAddingToSet$1(state.dirtyAtoms,key)
 };
} // Set a node value and return the set of nodes that were actually written.
// That does not include any downstream nodes which are dependent on them.

现在,我认为这可能是由于Edge不支持传播运算符。我认为也许使用recoiljs进行全局状态管理可能会导致问题,但是我不太确定。任何解决此问题的方法

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐