CommonsChunkPlugin & file-loader cause error.
See original GitHub issueWhen creating a common chunk from a chunk that loads assets with the file-loader I get:
Uncaught TypeError: Cannot read property 'call' of undefined
from:
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
It’s important to note that I don’t get this inlining assets with the url-loader.
Ive tried to create a limited test case here: https://github.com/cutandpastey/webpack-problem/tree/jp-common-file-loader
Steps to test:
- clone git@github.com:cutandpastey/webpack-problem.git
- checkout jp-common-file-loader
npm install
webpack
npm start
- open http://localhost:8080
That should do the trick.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
While running in normal mode it's not allowed to use a non ...
Anyone know what might be causing this error? My configuration for webpack is var webpack = require("webpack"); var ExtractTextPlugin = ...
Read more >CommonsChunkPlugin: Shared/Vendor Entry - SymfonyCasts
Under the plugins section, add new webpack.optimize.CommonsChunkPlugin() and pass that an object with two keys: name set to vendor and minChunks set to...
Read more >Migrating from Webpack 3 to 4 - AppOptics Blog
You may see an error like Error: webpack.optimize.CommonsChunkPlugin has been removed, please use config.optimization.splitChunks instead.
Read more >CommonsChunkPlugin | Lost a li
CommonsChunkPlugin ({ name: "main", children: true, minChunks: function ... Source maps are resource heavy and can cause out of memory issue for large...
Read more >babel-loader - webpack
Exclude libraries that should not be transpiled. core-js and webpack/buildin will cause errors if they are transpiled by Babel. You will need to ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
HI All
Just for information, I founf that this error it is a bit misleading, it is not a bug but the way how you build your common chunks. please refer to
https://github.com/webpack/webpack/tree/master/examples/multiple-commons-chunks or https://github.com/webpack/webpack/tree/master/examples/common-chunk-and-vendor-chunk
Thanks for the write-up @Taytay, this makes a lot of sense now but the error gives no hint as to what the issue is. Since the options for commons chunk plugin vary so widely, it would be nice if there were some sort of message that says you’re loading multiple runtimes or something.