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
Worker Loader + Module Federation breaks Webpack #10033
Comments
Wow, thanks very much for debugging this deeply. It sounds like it might be an upstream issue with webpack. Can you try to reproduce this with one of the webpack module federation example repos, in preparation for a bug report up to webpack? IIRC, the example at https://github.com/module-federation/module-federation-examples/tree/master/advanced-api/dynamic-remotes exercises some of the same parts of the module federation system that we exercise (compilation instructions for that repo are at https://github.com/module-federation/module-federation-examples#notes) |
@mlucool interesting... dumb question: what happens if you explicitly install inspiration:
|
Same thing. This is not a As a note, builder already depends on worker-loader, so that requirement was already met. |
Hi @jasongrout, This does not seem to be a clear module federation bug (although it could be module federation + something else we are doing here):
And it builds:
|
Description
If any of your code includes something that uses worker-loader, webpack fails to compile (it will eventually crash with OOM no matter how much memory you give it).
Reproduce
In an extension (e.g. extension-cookiecutter-ts):
Add pdfjs-dist as a dependency:
Add the following line anywhere that will be compiled (e.g. index.ts):
Now build:
Expected behavior
This should compile, but after a while, crashes with OOM.
I debugged this quite deep and the following I found very helpful to pinpoint that it was related to worker-loader.
webpackConfig
:Then, go and edit the source of
ProgressPlugin
and add something like this (you can write you own plugin to do this, but I found this cheaper):This helped me narrow it down to what it was stuck trying to do.
ModuleFederationPlugin
. Comment this out to see webpack finishes (which makes the extension not work, but shows webpack is ok withimport('pdfjs-dist/webpack');
)Context
3.0.12
The text was updated successfully, but these errors were encountered: