originjs / vite-plugin-federation

Module Federation for vite & rollup
Other
2.38k stars 242 forks source link

无法在remote提供的代码中使用 hooks #248

Open shinehs opened 2 years ago

shinehs commented 2 years ago

Versions

freedom0116 commented 2 years ago

Do vite-plugin-federation support singleton in shared setting? Just saw that singleton commented up in type define file. Maybe this is the reason host can't not import remote with react hooks. and here is the problem I faced now. image

flyfishzy commented 2 years ago

Sorry, we don't support singleton in shared yet. I think it can be added to the roadmap.

wildfire0304 commented 2 years ago

vue2.7 & 3 也很依赖这个 feature, setup script 是需要 defineComponent 的

caizhisheng commented 1 year ago

@shinehs 请问问题解决了么?我也遇到同样的问题,在远端服务中不设置shared 本地服务无法加载远端服务的共享模块,在远端服务中设置shared后, 本地服务可以正常加载远端服务的共享模块,这时远端服务自身无法运行,页面空白。(注:远端服务共享的模块为改该服务中的一个页面组件)

???