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
__webpack_require__.l is not a function after build in importRemote #551
Comments
do you have any dynamic imports in the application? You can try adding something like my AddRuntimeRequirementsToPromiseExternal plugin which inject loadScript as a requirement of webpack runtime (so its not shaken out) |
@ScriptedAlchemy thanks! That worked. I've added a plugin based on yours to keep |
Boom! |
I'm still having this issue. I'm using |
@eraffel-MDSol I suggest removing that condition. class AddRuntimeRequirement {
apply(compiler) {
compiler.hooks.compilation.tap('AddRuntimeRequirement', (compilation) => {
const { RuntimeGlobals } = compiler.webpack;
compilation.hooks.additionalModuleRuntimeRequirements.tap('AddRuntimeRequirement', (module, set) => {
set.add(RuntimeGlobals.loadScript);
});
});
}
} |
|
@eraffel-MDSol seems like that is not related to issue topic already. |
I'm using
importRemote
from@module-federation/utilities
for dynamic load of the modules inside the web component:And it works in development environment, but when I build the code with
ts
compiler and webpack, it thenimportRemote
call fails with the error:t.l
iswebpackRequire.l
call, which is literally__webpack_require__.l
call.When I log the
__webpack_require__
object inside theimportRemote
call, I see that it has onlyI,S,c,g,m,o
methods, but notl
.webpack configs for dev and prod are the same except
devServer
,ESLintPlugin
andmode: develoment
in dev config.Seems like this
l
method is not provided in webpack runtime which was created after build.What did I miss in using
importRemote
? Should I provide any additional details?The text was updated successfully, but these errors were encountered: