-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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.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. |
@t-hamano Why did you incorrectly add "Help Request" and removed "Bug" from this? It's a bug, and it should behave the exact same way as without the flag and output an array as the default config. @gziolo how is this "completed"? I do not understand why you close this. And I really do not feel like trial and erroring this. "Currently there need to be two configs to support ES Modules." What does this actually mean? So I need to write some custom code into my config that detects if the The way I see it, nothing is "completed" here, no commit is referenced. Just some "subject to change" bs. Leave it open then until it actually is fixed. Seems to me, it should pretty simple to make make it an array. |
I don't think this issue is a bug. If you want to know why the default config becomes an array when - If the default config is unified into an array, I think that developers who have already extended the default config in |
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/[email protected]
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: