-
After upgrading from React 18 to React 19, I started encountering the following issue in my microfrontend architecture using Webpack Module Federation and React Router v6.23. The container app uses created via createBrowserRouter. Each microfrontend (MFE) is lazy-loaded with React.lazy() and rendered inside . Each MFE includes its own router context (MemoryRouter or RouterProvider). Problem:
What I’ve tried: Wrapping MFEs in separate blocks Ensuring router contexts are not directly nested in the same tree Testing both createBrowserRouter and manual BrowserRouter in the container Attempted to control mounting/unmounting timing with useTransition() and guards Architecture overview:
Notes: I suspect it’s caused by overlapping concurrent renders in React 19’s new behavior. Questions: Are there recommended best practices for routing isolation in microfrontends under React 19? |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
I’m seeing the exact same error after moving to React 19. In our case: We also have a container using
It never happened in React 18, so it seems tied to React 19’s concurrent rendering unmount timing. Has anyone found a reliable way to prevent the new MFE’s router from mounting before the old one fully unmounts? Any pointers are much appreciated! |
Beta Was this translation helpful? Give feedback.
-
I’ve run into the same issue recently and wasn’t sure if it was something I misconfigured or an actual bug. Glad to see I’m not the only one ! |
Beta Was this translation helpful? Give feedback.
-
I have the same issue and I am currently unsure how to proceed with updates from React 18 to React 19 without making significant changes to my architecture. |
Beta Was this translation helpful? Give feedback.
-
we have same issue, now we started upgrade of React 18.2 to 19 version and we have the same setup of microfrontends and routing. Please provide solution for it. |
Beta Was this translation helpful? Give feedback.
-
Same issue after upgrading to React 19 — getting the double error when switching MFEs quickly. Curious to hear how others are handling routing isolation now. |
Beta Was this translation helpful? Give feedback.
-
👋 We're encountering the same issue after upgrading to React 19 in a microfrontend setup using Webpack Module Federation, React.lazy, and Suspense. Each MFE includes its own router context, and the host app uses createBrowserRouter. |
Beta Was this translation helpful? Give feedback.
-
After upgrading to React 19, we're facing issues in our microfrontend architecture that leverages Webpack Module Federation along with React.lazy and Suspense. |
Beta Was this translation helpful? Give feedback.
-
We’re encountering the same issue after upgrading to React 19, using a similar microfrontend setup. We’d appreciate any guidance or official recommendation for handling routing isolation in microfrontend architectures under React 19 — ideally without needing a full routing refactor across MFEs. |
Beta Was this translation helpful? Give feedback.
-
We’re running into the same error after upgrading to React 19. Any ideas on how to fix it? |
Beta Was this translation helpful? Give feedback.
-
me and my team also faced the same issue, any ideas how we can fix that? |
Beta Was this translation helpful? Give feedback.
-
I've faced the same issue, hope I'll find a solution here! |
Beta Was this translation helpful? Give feedback.
-
Fixed by removing 'react-router-dom' from shared in ModuleFederationPlugin |
Beta Was this translation helpful? Give feedback.
Fixed by removing 'react-router-dom' from shared in ModuleFederationPlugin