在/ expo / build / Notifications中找不到AsyncStorage模块

时间:2020-01-02 14:48:17

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

尝试在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做出反应。请帮助解决此问题,如果您需要其他详细信息,请告诉我。

1 个答案:

答案 0 :(得分:5)

此模块(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

致谢