-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wp-scripts: using --experimental-modules causes TypeError: config.plugins is not iterable
when webpack.config.js is extending plugins.
#60537
Comments
TypeError: config.plugins is not iterable
when webpack.config.js is extending plugins.
Hi, |
yes |
Hi, |
yes |
Also recieving this error. Any help or did you resolve this? |
I'm not sure of the exact cause, but it seems that when the Therefore, I overwrote the settings for each element of the array as shown below, and the error no longer appeared: const WebpackNotifierPlugin = require( 'webpack-notifier' );
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const config = defaultConfig.map( ( config ) => {
return {
...config,
plugins: [ ...config.plugins, new WebpackNotifierPlugin( { onlyOnError: true } ) ],
};
});
module.exports = config; I hope this helps. |
Yes, @t-hamano is correct. Currently there need to be two configs to support ES Modules. That’s why it’s behind the experimental flag and subject to change in the future. |
Description
Reduced
webpack.config.js
. Works perfectly fine without--experimental-modules
commandline:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
@wordpress/scripts@27.6.0
node -v
v21.7.2
npm -v
10.5.0
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: