【问题标题】:Expo Build Web Cannot assign to read only property 'exports' of object '#<Object>' react-native-tab-selectorExpo Build Web 无法分配给对象“#<Object>”react-native-tab-selector 的只读属性“exports”
【发布时间】:2021-09-17 15:07:54
【问题描述】:

构建了一个目前可在 iOS 和 android 上运行的 Expo react 应用程序,但是当我为 web 构建它时,它一直显示为空白屏幕,并出现以下错误:

TypeError:无法分配给对象的只读属性“exports”

重现步骤:

expo build:web
npx serve web-build

【问题讨论】:

    标签: react-native expo react-native-web


    【解决方案1】:

    能够通过注释掉 node_modules/react-native-tab-selector/index.js 文件底部的导出来解决此问题:

    // module.exports = TabSelectorAnimation
    // module.exports.default = TabSelectorAnimation
    

    当我重新启动服务器并为 web 构建时,它就像魅力一样!

    【讨论】:

      猜你喜欢
      • 2020-06-26
      • 2019-04-27
      • 2021-09-26
      • 2019-11-28
      • 2019-06-13
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 2018-07-30
      相关资源
      最近更新 更多