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

@vitejs/plugin-legacy一起用,引用远程入口文件报错

Open Elemy opened this issue 2 years ago • 8 comments

相关依赖版本

  • vite-plugin-federation: v1.1.7
  • vite: v3.0.9
  • @vitejs/plugin-legacy:v2.0.1

复现demo

https://stackblitz.com/edit/github-kyokdx-u2bdcf?file=readme.md,app2%2Fvite.config.js,app2%2Fdist%2Fassets%2FremoteEntry-legacy.js

复现步骤: 1.安装相关依赖 2.进入app2目录 3.yarn build

问题描述

打包出来的入口文件remoteEntry-legacy.js异常

WechatIMG52

1和2.地址和不用@vitejs/plugin-legacy情况下不一样 3.这个地方会报e.forEach is not a function

Elemy avatar Sep 15 '22 08:09 Elemy

看起来是代码的替换冲突了,也许需要调整下插件的执行顺序。

flyfishzy avatar Sep 28 '22 13:09 flyfishzy

碰到了类似的问题

695648896 avatar Oct 18 '22 01:10 695648896

报错意思大概是是代码分离后,plugin-legacy找不到对应的chunk了 image

695648896 avatar Oct 18 '22 01:10 695648896

image @flyfishzy @ruleeeer help~

695648896 avatar Oct 18 '22 01:10 695648896

大佬们有解决吗,我这边也遇到了这个问题

foreverstars avatar Oct 13 '23 06:10 foreverstars

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


Have you guys solved it? I also encountered this problem here.

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

新版本解决了这个问题吗?

foreverstars avatar May 29 '24 10:05 foreverstars

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


Does the new version resolve this issue?

Issues-translate-bot avatar May 29 '24 10:05 Issues-translate-bot