Open alghifarifikri opened 5 months ago
remote配置
federation({ name: "shared-component", filename: "remoteEntry.js", exposes: { "./TestButton": "./src/components/test-button.vue", "./validate": "./src/utils/validate.ts", }, shared: ['vue'] }),
host配置:
proxy: { '/node_modules': { target: 'http://localhost:3333', changeOrigin: false, rewrite: path =>
/uepsuftpweb/${path} } }, plugins: [ federation({ name: "host-app", filename: "remoteEntry.js", remotes: { "shared_component": "http://localhost:4173/assets/remoteEntry.js" }, shared: ['vue'] }) ]
可以解决上述报错问题,但是模块联邦共享组件在 host端使用时,内部响应式数据的响应式丢失,dep属性值为undefined
Vue version
3.4.15
Link to reproduction
https://github.com/alghifarifikri/module-federation-poc.git
Steps to reproduce
Clone Repository, then :
npm install
/yarn install
, thennpm run dev
/yarn dev
to running host project (Using Nuxt JS)npm install
/yarn install
, thennpm run dev
/yarn dev
to running remote project (Using Vue JS)What is expected?
I create Carousel component in remote project, then I try to share with Module Federation. When host project access Carousel it's should be running well.
What is actually happening?
host project Error
Cannot read property 'isCE' of null error
because tags<slot>
in component Carousel.System Info
No response
Any additional comments?
I've read several references, but haven't been able to fix them. https://github.com/vuejs/core/issues/4344 https://github.com/vuejs/core/issues/7115 https://github.com/nuxt/nuxt/issues/13117 https://stackoverflow.com/questions/71063992/when-importing-self-made-vue-3-library-into-vue-3-project-uncaught-typeerror https://stackoverflow.com/questions/72036673/typeerror-cannot-read-properties-of-null-reading-isce-custom-component-li