You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to use optimization.splitChunks.cacheGroups in combination with commonjs results in broken output packages, importing of which fails with:
TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (/Users/garthk/src/webpack-4-bug/build/index.js:20:30)
If there's a documented way to get the entry bundle build/index.js to inhale the split bundle build/vendors.js so its imports don't fail, please let me know where it is and I'll file a PR to make it easier to find.
If the current behavior is a bug, please provide the steps to reproduce.
/Users/garthk/src/webpack-4-bug/build/index.js:20
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
^
TypeError: Cannot read property 'call' of undefined
at __webpack_require__ (/Users/garthk/src/webpack-4-bug/build/index.js:20:30)
(modules has keys ./src/index.ts, crypto, tty, and util, and we're trying to find a moduleId of ./node_modules/uuid/index.js in there. No wonder it's failing. Anyhow; comment out the splitChunks block in webpack.config.js, try again, and note no error.
What is the expected behavior?
Being able to split the output into multiple files andrequire the entry point without failure.
Bug report
What is the current behavior?
Attempting to use
optimization.splitChunks.cacheGroups
in combination withcommonjs
results in broken output packages, importing of which fails with:If there's a documented way to get the entry bundle
build/index.js
to inhale the split bundlebuild/vendors.js
so its imports don't fail, please let me know where it is and I'll file a PR to make it easier to find.If the current behavior is a bug, please provide the steps to reproduce.
Note error:
(
modules
has keys./src/index.ts
,crypto
,tty
, andutil
, and we're trying to find amoduleId
of./node_modules/uuid/index.js
in there. No wonder it's failing. Anyhow; comment out thesplitChunks
block inwebpack.config.js
, try again, and note no error.What is the expected behavior?
Being able to split the output into multiple files and
require
the entry point without failure.Other relevant information:
webpack version: 4.8.3
Node.js version: 8.11.2
Operating System: macOS, Linux
Additional tools: none
The text was updated successfully, but these errors were encountered: