vite-plugin-federation icon indicating copy to clipboard operation
vite-plugin-federation copied to clipboard

使用 legacy 时,host 应用会出错

Open VaJoy opened this issue 3 years ago • 9 comments

remote 应用执行 vite serve 或 vite build 都正常,但 host 应用执行 vite serve 或 vite build 都会失败。

host 执行 serve 后,运行 http://localhost:5001/ 后,页面上的错误: image

host 执行 build 的错误: image

我把该报错项目放在这里了。其使用的是官方 vue3-advanced-demo 修改的后的项目(主要改动点就是 remote 和 host 都加了 @vitejs/plugin-legacy,且 host 加上了 vite-plugin-top-level-await)。

VaJoy avatar Dec 13 '22 04:12 VaJoy

另外提一下,remote 应用只要使用了 @vitejs/plugin-legacy,都必须给 filename 带上 -legacy 才能通过构建(不然会报错),这种隐藏逻辑也很奇怪。

同款问题见 https://github.com/vitejs/vite/issues/6133#issuecomment-1247815477

VaJoy avatar Dec 13 '22 04:12 VaJoy

It looks like the problem is caused by the fact that both plugins depend on the file name +-------------------------------------------------------------------------------------------------- 看起来是因为两个插件都依赖于文件名称导致的问题

Jiannan-dev avatar Dec 30 '22 07:12 Jiannan-dev

同样的问题,有什么解决方法吗?

Deuscx avatar Mar 30 '23 01:03 Deuscx

同样的问题,有什么解决方法吗?

foreverstars avatar Oct 13 '23 07:10 foreverstars

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Same problem, any solution?

Issues-translate-bot avatar Oct 13 '23 07:10 Issues-translate-bot

Same problem, any solution?

foreverstars avatar May 27 '24 12:05 foreverstars

any updates?

chenhw avatar Jun 24 '24 07:06 chenhw

same problem🥲

liuwanlong avatar Aug 13 '24 06:08 liuwanlong