Open husayt opened 2 months ago
Need to turn off the hmr of the react plugin
Webpack host cooperates with rust remote. I guess HMR will also have problems, which requires customized special processing
When both the host and the remote are in dev mode, you need to ensure that react-refresh is a singleton and initialized earlier than react-dom. This may require modifying @vitejs/plugin-react I am currently giving priority to completing mf’s capabilities, and will look at react issues later.
Hmr typically requires us hooking into reacts devtools global to access hmr, if that helps we have a refresh runtime plugin in one of our libraries. Hmr only works when remotes use the json protocol not the js entry
I encountered the same problem when host ->webpack+react, remote vite+react Runtiem loading, So will we solve this problem from the perspective of the lib, or can we only close Vite's HMR
I'm not sure if it will be possible to apply cross bundler HMR. Let me think about it.
Vue React React-Refresh maintains singleton and is a dev version
---- Replied Message ---- | From | Zack @.> | | Date | 10/17/2024 00:25 | | To | module-federation/vite @.> | | Cc | zhn @.>, Comment @.> | | Subject | Re: [module-federation/vite] v1.0.0: Error when trying to load vite remote from webpack host. (Issue #65) |
I'm not sure if it will be possible to apply cross bundler HMR. Let me think about it.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Have tried loading our vite remote with host using module federation runtime but built with webpack. Get this error when calling
loadRemote()
:Remote should be able to be loaded by webpack host, especially if using MF2 runtime.