I am trying to build up a MFE application with Native Federation (v17.1.7)
I have a shell.
I have a remote defined in a different repository.
In my remote I have a service which uses some functions from lodash/fp
My shell does not use lodash/fp, so lodash is naturally not present in its package.json file.
Now, when I load the remote in the shell I get the following error on runtime in the console:
_angular_core-17_3_0-dev.js:3806 ERROR Error: Unable to resolve specifier 'lodash/fp' imported from http://localhost:5202/Routes.js
at throwUnresolved (es-module-shims.js:445:11)
at _resolve (es-module-shims.js:402:71)
at es-module-shims.js:850:32
at Array.map (<anonymous>)
at es-module-shims.js:846:45
at _ZoneDelegate.invoke (zone.js:368:26)
at _Zone.run (zone.js:130:43)
at zone.js:1260:36
at _ZoneDelegate.invokeTask (zone.js:403:31)
at _Zone.runTask (zone.js:174:47)
Example:
In my remote:
import { getOr } from 'lodash/fp';
...
let message: string = getOr(path, path, I18S[this.language()]);
I even tried to add something explicitely in the federation.config.js file of the remote:
Hello,
I am trying to build up a MFE application with Native Federation (v17.1.7)
I have a shell. I have a remote defined in a different repository.
In my remote I have a service which uses some functions from lodash/fp My shell does not use lodash/fp, so lodash is naturally not present in its package.json file.
Now, when I load the remote in the shell I get the following error on runtime in the console:
Example:
But it did not solve the problem.
Could you please help fixing the issue?
Thank you.