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.

Webpack 4 build TypeError: compilation.getAssets(...) is not iterable

See original GitHub issue
  • Operating System: Ubuntu 14.04
  • Node Version: 8.9.4
  • NPM Version: 5.6.0
  • webpack Version: 4.16.5
  • mini-css-extract-plugin Version: 1.3.4, 1.3.2, 1.3.1

Expected Behavior

Building process doesn’t throw any error and corresponding bundle and assets files are generated

Actual Behavior

The building process stops with the following error:

/home/igorb/Projects/var/www/team-work/public/node_modules/mini-css-extract-plugin/dist/loader.js:122
    for (const asset of compilation.getAssets()) {

TypeError: compilation.getAssets(...) is not iterable

The same behavior is seen on all the 1.3.x versions. Meanwhile the 1.2.1 version was able to complete the task with no issues.

Code

// webpack.config.js

https://gist.github.com/igorokb/2ec60f78c805e8763073f93017dd31f0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-akaitcommented, Jan 21, 2021

Update webpack to the latest 4 version

0reactions
peimanshcommented, Mar 2, 2022

I am having the same issue but 1.3.0 works, then I get this error on 1.3.1 Does it ring any bells ? Any clues for a potential fix ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack erroring on mini-css-extract-plugin loader
I understand getAssets is only available since webpack 4.40.0 https://webpack.js.org/api/compilation-object/#getassets. You could try:.
Read more >
Compilation Object - webpack
The Compilation object has many methods and hooks available. On this page, we will list the available methods and properties.
Read more >
webpack compilation.getassets is not a function - 掘金
3、然后,搜索了错误提示。 查看了链接地址为:https://github.com/webpack/we... 4、按照别人给的一个个方式去尝试。
Read more >
is not a function or its return value is not iterable in ReactJs ...
TypeError : react__WEBPACK_IMPORTED_MODULE_0_default is not a function or its return value is not iterable 1 | import useState from 'react'; ...
Read more >
mini-css-extract-plugin - npm
extracts CSS into separate files. Latest version: 2.7.2, last published: 23 days ago. Start using mini-css-extract-plugin in your project by ...
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