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
When I try to use NativeFederationTypeScriptRemote with ModuleFederationPlugin, I got an error: The "path" argument must be of type string. Received an instance of Object
I can workaround by moving ModuleFederationPlugin below NativeFederationTypeScriptRemote, or using spread ModuleFederationPlugin({ ...federationConfig })
it will not be trivial to address ordering concerns between plugin execution flows. You can submit a pr to the native type plugin that will throw error if it sees the compiler plugins are in the wrong order - this is a common issue in cross plugin integrations
@ScriptedAlchemy it's not about plugin execution flows. I think it's because ModuleFederationPlugin unnecessarily mutates configuration object.
Fixing that mutation logic would be better.
Describe the bug
When I try to use NativeFederationTypeScriptRemote with ModuleFederationPlugin, I got an error:
The "path" argument must be of type string. Received an instance of Object
My config:
I try to debug further, and I found that because ModuleFederationPlugin mutates federationConfig.exposes object
Here is the mutation
https://github.com/module-federation/core/blob/main/packages/enhanced/src/lib/container/ModuleFederationPlugin.ts#L134
options.exposes = containerManager.containerPluginExposesOptions;
I can workaround by moving
ModuleFederationPlugin
belowNativeFederationTypeScriptRemote
, or using spreadModuleFederationPlugin({ ...federationConfig })
But please fix this issue, avoid the mutation.
Reproduction
.
Used Package Manager
npm
System Info
Validations
The text was updated successfully, but these errors were encountered: