Webpack Module Federation and Zustand not sharing same store state

365 Views Asked by At

I'm using NX for my entire project and have several applications. 1 application is the main on with the Zustand store. We're using Webpack 5 Module Federation for each of the applications and this main store exposes the Zustand store for the other child applications to utilize.

Intermittently, on the first load, the child applications do not receive the updated Zustand store values. Only when I refresh the page that is housing all the module federated apps, then will it receive the updates values. Any visit after the first initialization, everything works just fine. Any suggestions or help would be awesome.

I made sure that each Module Federated application was hosted on the same server.

0

There are 0 best solutions below