Open shinehs opened 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.
Sorry, we don't support singleton in shared yet. I think it can be added to the roadmap.
vue2.7 & 3 也很依赖这个 feature, setup script 是需要 defineComponent 的
@shinehs 请问问题解决了么?我也遇到同样的问题,在远端服务中不设置shared 本地服务无法加载远端服务的共享模块,在远端服务中设置shared后, 本地服务可以正常加载远端服务的共享模块,这时远端服务自身无法运行,页面空白。(注:远端服务共享的模块为改该服务中的一个页面组件)
???
Versions
Reproduction
如果在remote提供的模块中,使用例如useEffect这样的hook,在host项目中使用该模块提供的组件的时候,直接会一个V.current.useEffect未定义的错误。
Steps to reproduce
这样提供组件没问题
这样就会报错
我的配置:
What is Expected?
希望得到回复
What is actually happening?
原因是在打包的代码块中: