tengmaoqing / vite-plugin-qiankun

保留vite es特性,快速接入乾坤微前端子应用
MIT License
464 stars 83 forks source link

打包报错 ReferenceError: ReadableStream is not defined #76

Open qjwsmile opened 2 months ago

qjwsmile commented 2 months ago

"vite-plugin-qiankun": "1.0.15" 这个版本已经用了一年多,今天突然打包时报错报错原因是引用了undici ,我发现是包里引用了cheerio库 "cheerio": "^1.0.0-rc.10" ,cheerio 3天前更新了最新版本1.0.0之后。就出现该问题

aceHubert commented 2 months ago

cheerio 1.0.0 必要node 18+以上

qjwsmile commented 2 months ago

cheerio 1.0.0 必要node 18+以上

是这样的,但是在vite-plugin-qiankun 的1.0.5项目里用的cheerio是 "cheerio": "^1.0.0-rc.10",3天前cheerio升级了1.0.0导致的该问题。我现在已经解决了 在项目里指定 "cheerio": "^1.0.0-rc.12" 就可以了,cheerio : 1.0.0 node版本不够会有问题

findfirecode commented 2 months ago

cheerio 1.0.0 必要node 18+以上

是这样的,但是在vite-plugin-qiankun 的1.0.5项目里用的cheerio是 "cheerio": "^1.0.0-rc.10",3天前cheerio升级了1.0.0导致的该问题。我现在已经解决了 在项目里指定 "cheerio": "^1.0.0-rc.12" 就可以了,cheerio : 1.0.0 node版本不够会有问题

你好, 是固定yarn.lock吗, 遇到同样问题, 请问具体怎么操作的

qjwsmile commented 2 months ago

cheerio 1.0.0 必要node 18+以上

是这样的,但是在vite-plugin-qiankun 的1.0.5项目里用的cheerio是 "cheerio": "^1.0.0-rc.10",3天前cheerio升级了1.0.0导致的该问题。我现在已经解决了 在项目里指定 "cheerio": "^1.0.0-rc.12" 就可以了,cheerio : 1.0.0 node版本不够会有问题

你好, 是固定yarn.lock吗, 遇到同样问题, 请问具体怎么操作的

需要指定cheerio版本,在package.json 添加 resolutions 字段,指定 cheerio 的版本:"resolutions": { "cheerio": "1.0.0-rc.12" } resolutions是和 dependencies同级的 我用的是1.0.0-rc.12版本就可以了,你试试 还是不行的话你在回复我 。我帮你看看

findfirecode commented 2 months ago

cheerio 1.0.0 必要node 18+以上

是这样的,但是在vite-plugin-qiankun 的1.0.5项目里用的cheerio是 "cheerio": "^1.0.0-rc.10",3天前cheerio升级了1.0.0导致的该问题。我现在已经解决了 在项目里指定 "cheerio": "^1.0.0-rc.12" 就可以了,cheerio : 1.0.0 node版本不够会有问题

你好, 是固定yarn.lock吗, 遇到同样问题, 请问具体怎么操作的

需要指定cheerio版本,在package.json 添加 resolutions 字段,指定 cheerio 的版本:"resolutions": { "cheerio": "1.0.0-rc.12" } resolutions是和 dependencies同级的 我用的是1.0.0-rc.12版本就可以了,你试试 还是不行的话你在回复我 。我帮你看看

已经解决了, 感谢

yufeiant commented 1 month ago

怎么解决的呢?

qjwsmile commented 1 month ago

怎么解决的呢?

需要指定cheerio版本,在package.json 添加 resolutions 字段,指定 cheerio 的版本:"resolutions": { "cheerio": "1.0.0-rc.12" } resolutions是和 dependencies同级的 我用的是1.0.0-rc.12版本就可以了,你试试