运行代码时出现以下运行时错误。我确实有一切正常,但开始收到此错误并在我的npm上运行更新。所以我不确定错误发生在哪里。
Uncaught TypeError: Cannot read property 'bool' of undefined
at Object.<anonymous> (bundle.js:68041)
at __webpack_require__ (bundle.js:67829)
at bundle.js:67849
at bundle.js:67852
at webpackUniversalModuleDefinition (bundle.js:67802)
at Object.defineProperty.value (bundle.js:67809)
at __webpack_require__ (bundle.js:20)
at Object.defineProperty.value (bundle.js:37173)
at __webpack_require__ (bundle.js:20)
at Object.defineProperty.value (bundle.js:35709)
这是我的webapck配置:
const path = require('path');
module.exports = {
entry: './js/index.js',
output: {
path: path.resolve('./public/bis/js/'),
filename: 'bundle.js'
},
module: {
rules: [
{ test: /\.jsx?$/, loader: 'babel-loader', exclude: /node_modules/ }
]
}
}
这是我的package.json:
"dependencies": {
"react": "latest",
"react-dom": "latest",
"react-bootstrap": "^0.32.1",
"react-router-dom": "latest",
"@types/globalize": "0.0.31",
"axios": "^0.16.2",
"bootstrap": "^4.0.0-alpha.6",
"create-react-class": "^15.6.2",
"globalize": "^1.3.0",
"jquery": "^3.0.0",
"moment": "^2.20.1",
"popper.js": "^1.11.0",
"prop-types": "^15.6.0",
"react-bootstrap-date-picker": "^5.1.0",
"react-drawer": "^1.2.5",
"react-fontawesome": "^1.6.1",
"react-moment": "^0.7.0",
"react-redux": "^5.0.6",
"react-select": "^1.2.1",
"react-widgets": "^4.1.2",
"react-widgets-globalize": "^4.0.5",
"react-widgets-moment": "^4.0.5",
"reactstrap": "^5.0.0-alpha.4",
"redux": "^3.7.2",
"redux-promise": "^0.5.3",
"webpack": "^2.2.1"
},
"devDependencies": {
"babel-core": "^6.23.1",
"babel-loader": "^6.3.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react": "^6.23.0",
"babel-register": "^6.26.0",
"chai": "^4.1.2",
"enzyme": "^3.2.0",
"enzyme-adapter-react-16": "^1.1.0",
"enzyme-to-json": "^3.2.2",
"jest": "^21.2.1",
"jsdom": "^11.5.1",
"mocha": "^4.0.1",
"node-sass": "^4.7.2",
"nodemon": "~1.3.8",
"react-test-renderer": "^16.1.1",
"redux-test-utils": "^0.2.2",
"request": "^2.83.0",
"request-promise-core": "^1.1.1",
"sinon": "^4.1.3"
}
围绕68041的代码与react-drawer
有关任何想法,在网上似乎react-bootstrap经常有这个错误,但我更新到最新版本。没有修复错误。错误说明webpackUniversalModuleDefinition是问题所在,但我没有在谷歌上找到任何关于它的内容。
提前致谢。