Closed RXJ966 closed 4 months ago
I have the same issue. On the module side, I use the following configuration:
federation({ name: 'module1', filename: 'remoteEntry.js', exposes: { './RemoteComponent': './src/components/RemoteComponent.vue', }, shared: ['vue'] });
On the container side, I configure it like this:
federation({ name: 'core', remotes: { module1: 'http://localhost:3001/assets/remoteEntry.js', }, shared: ['vue'] });
When I launch both applications, I get the following: in conosle http://localhost:3001/assets/remoteEntry.js 404 Not Found
If I specify:
remotes: { module1: 'http://localhost:3001/dist/assets/remoteEntry.js', }
It works, but changes are not reflected during development, even with vite build --watch. I still don't understand which path to specify in remotes?
Issue has been resolved, I was using just App instead of App.tsx in the expose. So, updated the below configuration and it is working as expected.
Incorrect syntax
exposes: {
'./App': './src/App'
},
Correct syntax
exposes: {
'./App': './src/App.tsx'
},
Versions
Reproduction:
I have created two ReactJs apps i.e., host app(shell) and Remote app using latest React + Vite + Typescript. When I open the application, able to view the images from the host app but the remote app is not showing the images.
When I build the app, images are placed in the dist/assets folder but when I inspect the browser source tab, it is not loading the images.