8 likes
·
38.6K reads
8 comments
I'm facing one issue with Module Federation For NextJs with Tailwind CSS. How to config tailwind css in the NextJS remote app and host app? Or How to get the tailwind CSS code for the remote app to host app and assets images?
I recommend you to read this article if you already haven't.
malcolmkee.com/blog/using-tailwindcss-with…
It is not nextjs, but similar approach should work in your case.
How can I expose a component which needs to do an API call to full fill that component? And when I'm using that component in another repo it should be rendered on the server side.
And tell me is there any way to do a serverside call in the next js component level not in the page level?
What you want it is the new feature of Next.js called App Router, which is not supported by Module federation.
Here you can find how to fetch data on server-side directly in React components nextjs.org/docs/app/building-your-applicat…
Alibek Kazhibekov For example, in the page router, we have a banner component, to show a banner image we need to do an API call to fetch the image. And I want a reusable component that I can expose and use in another repository and I want all this to happen from the server side. And How to call the SSR method inside the component.
The NextJS component level is necessary. how to write an SSR method. Is there another most recent bundle available?
Hi Alibek,
Have you tried using NextJs SSG (Static site generation). we are able to create a next app with SSG and it was running fine with production build (ex: out folder). however when we try to load static remote page (remoteEntry.js) in host application. getStaticProps are not being called.
What we are trying to achieve is to create a next page with SSG and deploy the production build in any S3 bucket (no runtime/ serveless), refer remoteEntry.js in host application
If you any insights on this please help
Great article. How can you import the hooks from another remote? It would fail if It is dynamic