webpack: Uncaught TypeError: Cannot read property 'call' of undefined
I get the following error after an npm install (@1.5.3) (in the browser code i.e., the build goes through fine)
Uncaught TypeError: Cannot read property 'call' of undefined
2.2.js.map:1 GET http://.../static/build/2.2.js.map 404 (Not Found)
The error line is
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
Module ID 172.
The state reveals the following… what am I missing?
"id": 172,
"identifier": "/pathtorepo/js/components/pages /^\\.\\/.*$/",
"name": "./js/components/pages ^\\.\\/.*$",
"size": 3656,
"cacheable": true,
"built": true,
My async loads look like this:
require(['../components/pages/' + pathtocomp], function(Comp) {
// stuff
});
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 2
- Comments: 23 (7 by maintainers)
I fix this problem after remove
manifest
config under:But Is still not know the reason.
Curiously adding commons chunk plugin (and then removing it) fixed it for me. Its happening on ‘one’ another colleague’s environment as well where commons isn’t fixing it.
@Pines-Cheng: it worked for me as well. It would be nice to know what happened and how to get the manifest back 😃
Are you deliberately using a dynamic
require()
? That’s not directly causing this issue, but may somehow be related.Dynamic requires will not be supported by ES6 modules.