Closed noamfeldman closed 8 months ago
Hey @noamfeldman , it may be unrelated, but some of your @nrwl/ or @nx/ packages don't line up with the version of nx
you have installed. Aside from @nrwl/nx-cloud
, all packages under the nrwl scope should generally be set up with the same version.
Can you correct this and check that the issue still reproduces? An easy way to fix this would be to run nx migrate 16.4.2
Alternatively, updating to latest with nx migrate latest
would also work.
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
We have a React host/remote micro-frontend application with shared-components library:
The state of the application is managed using the
zustand
state management library. Before migrating to NX 16.4.2, all remote applications used the same state instance. However, after the migration, each remote application now has its own state instance.For example, the host application is a container app that contains the application's main navigation menu and logged in user information. When a logged in user changes their preferred theme or timezone, this change will affect all remote applications that use the same
zustand
state management library. However, after the migration, this default behavior no longer works.A workaround that seems to solve the issue is adding the following "
shared
" settings to the host's (container)module-federation.config.js
file settings:Expected Behavior
Keep the default behavior of state management as it was before the migration
GitHub Repo
No response
Steps to Reproduce
shared-components
with state management that will be used for read and update the store's state. For example:Nx Report
NX Report Before Migration
NX Report After Migration
Failure Logs
No response
Operating System
Additional Information
This is our
package.json
file: