Next.js Discord

Discord Forum

Hydration Problem micro-frontend

Unanswered
desout posted this in #help-forum
Open in Discord
We are using now next.js as a proxy of main site and for development needs we are not using next config, bceause it's require to replace bundles from QA env with local one( check screenshot)

We are using monorepo and loading all required modules on the page. One of the script loading async and updating dom node with icon ( while loading). It's react application with separate entry point

export const rootMyAccountElement = document.querySelector('[data-my-account-entry]');

It can be checked, that while page loading, this icon attached, required requests sended and bundle is working, but AFTER that hydration starting and we can see, that icon disappeared and hydration error shown(again screenshots)

How to resolve next issue and wait until hydration?

1 Reply

Fixed with replacing scripts from html with Script component from next