Replies: 4 comments
-
Is there a reason why you start multiple server and don't import the code from other apps via JS imports? Related answer: vitejs/vite-plugin-react-swc#87 (comment) |
Beta Was this translation helpful? Give feedback.
-
Yes, the reason is that I'm working on a micro frontend setup that should be work with runtime instead of build time integration. I guess this issue would also effect anyone trying to build single-spa react apps with vite. I'm trying to achieve something similar, I'm setting up some things for myself for educational purpose Thanks for the link! didn't missed that one, but yes it's exactly my issue. I'm trying the proposed solution there |
Beta Was this translation helpful? Give feedback.
-
We have a similar approach, we are using it in production for over one year, hmr is working ok. We are using qiankun with some modification of the vite-plugin-qiankun. Prior to v 4 it worked with no problem, now we are getting an |
Beta Was this translation helpful? Give feedback.
-
I released 4.0.3 without this check! |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on a micro frontend playground where I'm trying out vite + react + micro frontends.
I'm just starting and I have a container application build with react and a single app. The app exposes a web component build with react that I want to include.
The project can be found here
The container's index.html includes the app-one entry point served though its dev server. Since both the container and the app-one use react, I get the error that the @react-refresh runtime is included twice.
Is there a way to make this setup work with HMR? I have researched how to externalize the @react-refresh module so that it's included only once, but I haven't found a way yet. I found that for backend integration setups, sometimes the base must be configured, but this would affect all code, not just @react-refresh. Likewise, It would be at least better to disable @react-refresh and have HMR for all things except component refresh, but that also doesn't seem possible atm.
Is there a way currently to make this work? Should this be a feature request instead?
Beta Was this translation helpful? Give feedback.
All reactions