question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CommonsChunkPlugin & file-loader cause error.

See original GitHub issue

When 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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
acostafcommented, Jul 1, 2016

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

0reactions
cchamberlaincommented, Dec 14, 2015

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found