-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream remoteEntry.js updates with 'react-18-ssr' architecture throws errors #3167
Comments
you need to clear require cache when remote changes. likely no example of that here, but module-federation/node package has the utils |
Thanks @ScriptedAlchemy . I have been looking at your module-federation/node repo and issues for the logic to get express require cache completely cleared and restored using the module-federation/core#397 (comment) I will update you there, but thank you for answering. I see all the repos you contribute to in this area. Thank you so much! |
Yeah for express you need to clear the route stack, the node readme has a section on clearing express route stack cache |
We are also working on fast refresh and HMR support, this should useable in production node too, so we can use webpack effecent HMR in prod servers to elegantly replace modules as they are updated instead of the nuclear option of wiping the require cache |
That sounds amazing. Is there something on a roadmap that I can track? I will keep my eyes open! |
Is the React-18-ssr architecture intended to adapt to changing upstream remoteEntry.js files? I tried this architecture and when my upstream app reloaded, I had trouble refreshing the SSR application to perform a re-render and therefore the rehydration threw an error:
It looks like there will be errors when an upstream application changes unless the SSR application is restarted. I tried to remove the App from the module cache to workaround this issue when a change is detected. In a production environment, it would be necessary to avoid the "Text content does not match server-rendered HTML." The remotes would not be in the same container and there would be synchronization issues that result in this error appearing in production.
This example seems robust except for this potential issue. I have looked for a graceful runtime fix but could this be a limitation to the architecture?
The text was updated successfully, but these errors were encountered: