My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
Alibek Kazhibekov

7 likes

·

32.6K reads

8 comments

jaya prakash
jaya prakash
Jul 20, 2023

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?

·
·1 reply
Alibek Kazhibekov
Alibek Kazhibekov
Author
·Jul 20, 2023

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.

·
jaya prakash
jaya prakash
Jul 27, 2023

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?

·
·2 replies
Alibek Kazhibekov
Alibek Kazhibekov
Author
·Jul 27, 2023

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…

·
jaya prakash
jaya prakash
Jul 27, 2023

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.

·
jaya prakash
jaya prakash
Jul 31, 2023

The NextJS component level is necessary. how to write an SSR method. Is there another most recent bundle available?

·
Jatin Gundabathula
Jatin Gundabathula
Aug 29, 2023

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

·
Pedro López
Pedro López
Jan 22, 2024

Great article. How can you import the hooks from another remote? It would fail if It is dynamic

·