Closed Garin151 closed 1 year ago
更新前使用的哪个版本?
之前项目用的是umi 3.5.21;react-vant版本是3.0.2
这边没调整过构建,方便给个复现的demo吗
umi3的配置和锁定的webpack有缺陷。
升级umi到4;或保持umi3,手动降级 react-spring
到 9.6.1
npm i @react-spring/web@9.6.1
这边没调整过构建,方便给个复现的demo吗 公司项目,不好给demo
umi3的配置和锁定的webpack有缺陷。
升级umi到4;或保持umi3,手动降级
react-spring
到 9.6.1npm i @react-spring/web@9.6.1
安装后,还是没作用
npm i @react-spring/web@9.6.1
npm i @react-spring/web@9.6.1
感谢,最后选择了用umi4重新搭建项目
Which React Vant packages are impacted?
react-vant
(React Vant core)react-vant-icons
(React Vant Icon)What version of React Vant are you using?
3.1.16
Reproduce live demo(codesandebox or stackblitz)?
No response
Descripition
使用umi 3.5.37版本搭建项目,安装react-vant依赖。一开始跑项目,报错:./node_modules/@react-spring/shared/dist/index.mjs 881:9-11 Can't import the named export 'raf' from non EcmaScript module (only default export is available)。
百度一下,说是新版webpack的问题。改了一下webpack配置如下: chainWebpack(config) { config.module .rule('mjs') .test(/.mjs$/) .type('javascript/auto') .include.add(/node_modules/) .end(); }, 终于跑了起来。但是,一使用Swiper组件,就会报错:Uncaught TypeError: A is not a function 控制台定位是:./node_modules/@react-spring/shared/dist/index.js:1 感觉react-vant依赖的@react-spring的问题。 希望能排查一下,并修复一下,感谢大佬们