我将项目从matererial-ui 3升级到了4,但最终出现此错误:
Uncaught (in promise) Error: Cannot find module '../node_modules/@material-ui/core/esm/internal/SwitchBase.js'
at newRequire (src.e31bb0bc.js:37)
at newRequire (src.e31bb0bc.js:21)
at localRequire (src.e31bb0bc.js:53)
at Object.parcelRequire.../node_modules/@material-ui/core/esm/Checkbox/Checkbox.js.@babel/runtime/helpers/extends (Checkbox.js:6)
at newRequire (src.e31bb0bc.js:47)
at localRequire (src.e31bb0bc.js:53)
at Object.parcelRequire.../node_modules/@material-ui/core/esm/Checkbox/index.js../Checkbox (index.js:1)
at newRequire (src.e31bb0bc.js:47)
at localRequire (src.e31bb0bc.js:53)
at Object.parcelRequire.containers/Login/index.js.react (index.js:9)
在第9行导入index.js:
import Checkbox from '@material-ui/core/Checkbox';
我不认为此问题与包裹捆扎机有关,但有幸的是,我注意到我在这里使用它。
这是确切的版本:
"parcel-bundler": "1.12.3",
"@material-ui/core": "^4.1.3",
"@material-ui/icons": "^4.2.1",
"@material-ui/lab": "^4.0.0-alpha.18",
"@material-ui/pickers": "^3.1.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
赞赏任何建议。