I am trying to implement Module Federation in our existing app
I have completed all the required configurations after which both container and remote are working independently.
The problem is when I call remote component from container it shows error
Loading chunk defaultVendors-node_modules_mui_icons-material_ArrowDownward_js-node_modules_mui_icons-materi-35b08b failed.
(error: http://localhost:2000/defaultVendors-node_modules_mui_icons-material_ArrowDownward_js-node_modules_mui_icons-materi-35b08b.3de50f8f.js)
while loading "./RemoteModule" from webpack/container/reference/RemoteEntry
my container is running on : http://localhost:2000 and
remote is running on http://localhost:2500
I am wondering why url in error is point to container instead of remote? Is this the issue?
configuration part of container
output: {
path: __dirname + '/build',
publicPath: '/',
filename: '[name].[hash:8].js',
sourceMapFilename: '[name].[hash:8].map',
chunkFilename: '[id].[hash:8].js'
},
devServer: {
static: './build',
port: 2000,
open: true,
historyApiFallback: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
},
configuration part of remote
output: {
path: __dirname + '/build',
publicPath: '/',
filename: '[name].[hash:8].js',
sourceMapFilename: '[name].[hash:8].map',
chunkFilename: '[id].[hash:8].js'
},
devServer: {
static: './build',
port: 2500,
open: true,
historyApiFallback: true,
headers: {
'Access-Control-Allow-Origin': '*',
},
},
Please help