Unable to consume the shared library by HOST in Module Federation

I am working on Module Federation, and I have built One host app and several remote apps.
The thing is I have installed some dependencies at host side and want to share it its remotes, so that the remotes does not need to install these dependencies again.

From my host app webpack.config.js, I’m sharing the dependencies, show below:

shared: {
...deps,
react: {
singleton: true,
requiredVersion: deps.react,
},
"react-dom": {
singleton: true,
requiredVersion: deps["react-dom"],
},
"react-router-dom": {
singleton: true,
requiredVersion: deps["react-router-dom"],
},
"react-redux": {
singleton: true,
requiredVersion: "9.1.2",
},
"@reduxjs/toolkit": {
singleton: true,
requiredVersion: "2.2.7",
},
},

and in the remote apps, I'm consuming it as:
shared: {
react: {
singleton: true,
requiredVersion: deps.react,
},
"react-dom": {
singleton: true,
requiredVersion: deps["react-dom"],
},
"react-router-dom": {
singleton: true,
requiredVersion: false,
},
"react-redux": {
singleton: true,
requiredVersion: false,
},
"@reduxjs/toolkit": {
singleton: true,
requiredVersion: false,
},
},

The thing is whenever I build all the apps, using npm run build command, I get
at host that it shared the libraries:
provide-module modules 210 bytes
provide shared module (default) @reduxjs/[email protected] = ./node_modules/@reduxjs…(truncated) 42 bytes [built] [code generated]

  • 4 modules:

But at while building the remote apps, I get:

consume-shared-module modules 84 bytes
consume shared module (default) react@* (singleton) 42 bytes [built] [code generated]
consume shared module (default) react-redux@* (singleton) 42 bytes [built] [code generated]

ERROR in resolving fallback for shared module react-redux

What I see is, the host is sharing the dependencies and remotes are receiving it, but still on building the remote apps, it is looking for the libraries in inside its node_modules directory

What I see is, the host is sharing the dependencies and remotes are receiving it, but still on building the remote apps, it is looking for the libraries in inside its node_modules directory