You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build enters an infinite loop, the child compilation calling itself in a recursive way.
Expected Behavior
The compilation should finish
How Do We Reproduce?
I've created a repository with a basic project that reproduces the bug.
It happens when we use both:
explicit import for Module Federation shared library (see in webpack.config.js)
experimentalUseImportModule to false for Mini Css Extract Plugin (see in webpack.config.js)
The problem is due to the child compiler copying the configuration of the parent compilation including ModuleFederation plugin with the explicit import on shared library.
I've removed the Module Federation plugin from the child compilation but it seems there is still something to be removed
constchildCompiler=/** @type {Compilation} */this._compilation.createChildCompiler(`${MiniCssExtractPlugin.pluginName}${request}`,outputOptions,[]);// The templates are compiled and executed by NodeJS - similar to server side rendering// Unfortunately this causes issues as some loaders require an absolute URL to support ES Modules// The following config enables relative URL support for the child compilerchildCompiler.options.plugins=childCompiler.options.plugins.filter(plugin=>{returnplugin.constructor.name!=="ModuleFederationPlugin";})||[];
Please paste the results of npx webpack-cli info here, and mention other relevant information
This is just a repository I've created to reproduce the bug and discuss a solution, the bug we're facing happens in a far more bigger project than the one provided and is far more complex. I've only reduced it to something simpler and lighter so we can debug easily.
@alexander-akait I've just set to false to reproduce the same behavior we're facing in our real project, meaning it uses the child compilation and does not enter the if
@vankop I'm not sure I understand what you mean by css should be extracted?
I understand that this is a really specific edge case that may not concern a lot of people but as far as I understand the options we're using experimentalUseImportModule and explicit import in MF shared properties are legitimate options of both webpack in this plugin and it should then work properly.
I think I have a good understanding of why it's happening and I'm willing to contribute with a PR like the code I've proposed above but for some reason something is still missing. If you know why after removing the ModuleFederationPlugin from the child compilation it still tries to import the js file it would help a lot :-)
Bug report
Actual Behavior
The build enters an infinite loop, the child compilation calling itself in a recursive way.
Expected Behavior
The compilation should finish
How Do We Reproduce?
I've created a repository with a basic project that reproduces the bug.
It happens when we use both:
experimentalUseImportModule
tofalse
for Mini Css Extract Plugin (see in webpack.config.js)The problem is due to the child compiler copying the configuration of the parent compilation including ModuleFederation plugin with the explicit
import
on shared library.I've removed the Module Federation plugin from the child compilation but it seems there is still something to be removed
Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: