Closed onlyling closed 7 months ago
补充一下具体报错信息
补充一下具体报错信息
已补充。
应该是报错的依赖在 node_modules
下存在多个版本,dev 下 MFSU 会强制保留一个版本(可能正好是需要的版本)所以不会报错,dev 配置 mfsu: false
可以验证
临时解决了,react-native-web
并没有到导出 InputAccessoryView
,react-native-svg
在 web 端没有导出 SvgXml
,手动做一些修复。
// umi-fix/react-native-svg.js
export * from 'react-native-svg/src/ReactNativeSVG.web'
export const SvgXml = () => {}
// umi-fix/react-native.js
export * from 'react-native-web'
export const InputAccessoryView = () => {}
// .dumirc.ts
import { defineConfig } from 'dumi'
export default defineConfig({
alias: {
'react-native$': path.join(__dirname, 'umi-fix/react-native.js'),
'react-native-svg$': path.join(__dirname, 'umi-fix/react-native-svg.js'),
}
})
Version
2.2.14
OS Version
macOS 13.6.2
Node.js Version
18.19.0
Browser Version
119.0.6045.199
Link to minimal reproduction
https://github.com/hjfruit/react-native-xiaoshu/tree/doc-next
Steps to reproduce
What is expected?
What is actually happening?
同一套配置,在不同的环境打包出现了差异。
Any additional comments? (optional)