Home > Software engineering >  Error: Module "./menu-items" does not exist in container
Error: Module "./menu-items" does not exist in container

Time:03-30

Webpack config for 'provider':

 new ModuleFederationPlugin({
      ...
      remotes: {
        ...
      },
      exposes: {
        "./api-helpers": "./src/api-helpers",
        "./menu-items": "./src/menu-items",
      },
      shared: {
        ...
      },

I am getting this on the consumer:

enter image description here

Is this related to the hiphen in menu-items?

CodePudding user response:

My consumer remotes were incorrectly configured:

'store': 'store@http://localhost:4019/remoteEntry.js',
'api-helpers': 'store@http://localhost:4002/remoteEntry.js'

Changing the second line to the following fixed the issue.

'api-helpers': 'api-helpers@http://localhost:4002/remoteEntry.js'
  • Related