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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top 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 >
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
Update webpack to the latest
4
versionI 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 ?