Is there no more correct solution for next.js with ssr?
See original GitHub issueIs there no hack-free solution https://github.com/module-federation/module-federation-examples/blob/master/nextjs-ssr/host/next.config.js
remoteLib: isServer
? "remoteLib@http://localhost:3002/node/remoteEntry.js"
: //This is a hack (I cannot run successfully MF in client-side with NextJS and React, maybe doing smth wrong)
{
external: `external new Promise((r, j) => {
window['remoteLib'].init({
react: {
"${packageJsonDeps.react}": {
get: () => Promise.resolve().then(() => () => globalThis.React),
}
}
});
r({
get: (request) => window['remoteLib'].get(request),
init: (args) => {}
});
})`,
},
// : "remoteLib@http://localhost:3001/remoteEntry.js",
},```
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
How to Disable Server-Side Rendering (SSR) in Next.js
Step 1: Rewrite All Requests to pages/index.js · Step 2: Disable SSR for Page Content · Step 3: Check that Everything Works with...
Read more >react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >Hey Next.js, Is Server Side Rendering Dead?
Next.js is not the first solution to introduce SSR with React, but it shows an excellent way to fetch data(AKA: getInitialProps).
Read more >Next.js No longer use SSR/SSG functions - YouTube
Next. js 13 brought a complete redesign to the Data fetching system. No more getServerSideProps or getStaticSideProps and no more separation ...
Read more >SSR vs SSG in Next.js – a practical overview for CTOs and devs
Next.js pre-renders pages using static generation, which among other things means that it doesn't fetch any data by default. If you need to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Close to releasing SSR support as a plugin for next. Already in production and should go into open beta soon
Yeah the core code has changed quite a bit and I’ve been focusing on internal app upgrades. im refreshing the implementation now to bring everything back up. It’s several releases behind right now, but I’ve got it up locally again so likely just need to redeploy the apps with the new plugin code