【问题标题】:AsyncStorage module not found in /expo/build/Notifications在 /expo/build/Notifications 中找不到 AsyncStorage 模块
【发布时间】:2020-01-02 14:48:17
【问题描述】:

当我尝试在 web 模式下运行应用程序时,我遇到了下面提到的错误。

/node_modules/expo/build/Notifications/Notifications.js
Module not found: Can't resolve 'react-native-web/dist/exports/AsyncStorage' in '/Users/i322865/node_modules/expo/build/Notifications'

我正在使用最新的 expo(0.36,我在使用 0.35 版本时也遇到了同样的错误)并对原生 web 0.12.0-rc.1 做出反应。请帮助解决此问题,如果您需要更多详细信息,请告诉我。

【问题讨论】:

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


    【解决方案1】:

    此模块 (AsyncStorage) 在 react-native-web 上不可用:^0.12

    如果需要使用 AsyncStorage 可以使用版本:"react-native-web": "0.11.7",

    PS:您可以在此问题上查看有关该主题的更新:https://github.com/necolas/react-native-web/issues/1515

    官方立场是:

    Use 0.11 until the community packages add web support. 
    They've known this was coming for 9 months react-native-community/async-storage#52
    

    问候

    【讨论】:

    • 谢谢。我会检查并通知你
    • 你好。我在 package.json 中添加了依赖项“react-native-web”:“0.11.7”,但仍然收到错误“尝试导入错误:'AsyncStorage' 未从 'react-native-web/dist/ 导出/指数'。”。我想这与上面的问题相同。你知道我的问题是什么吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-20
    • 2019-10-12
    • 1970-01-01
    • 2022-10-07
    • 2019-11-05
    • 2021-06-04
    • 2014-04-21
    相关资源
    最近更新 更多