Open bflopez opened 1 year ago
The issue is related to the fact that thia module generates esm files which are not supported by nextjs module federation
@bflopez Did you manage to get this working?
facing the same issue with react(no next.js) , did you find a soltuion? @bflopez @nick4fake link to my issue: https://github.com/originjs/vite-plugin-federation/issues/576
Also does not work on my side, even with the following remote Vite app
import "./App.css";
function App() {
return (
<div className="App">
<h2>Remote</h2>
</div>
);
}
export default App;
Versions
Reproduction
https://github.com/module-federation/module-federation-examples/tree/master/nextjs-react
Additional Details
Vite module federation seems to work for me everywhere except when NextJS is the host app. Above is a link to a nextjs repo that works with a webpack remote but if you add a vite app and use this plugin to expose a vite remote I just get `ScriptExternalLoadError: Loading script failed.` The module does exist and I can go to it in my browser. It works if Vite is host or another Webpack app is host but can't seem to get it to work with NextJS host.
This is the Vite Config
This is the NextJS config