Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AsyncStorage module not found in /expo/build/Notifications

I'm getting the below mentioned error when i try run application in the web mode.

/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'

I'm using the latest expo(0.36, same error i faced when i was using 0.35 version as well) and react native web 0.12.0-rc.1. Please help to solve this issue and let me know if you require any further details.

like image 794
coders Avatar asked Jan 02 '20 14:01

coders


People also ask

Where is async storage stored?

React Native on Android actually uses SQLite to back up the AsyncStorage API. The database file is /data/data/<your_app>/databases/RKStorage on your device/emulator. Keys and values are stored in a table named catalystLocalStorage .

What is async storage?

AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage. It is recommended that you use an abstraction on top of AsyncStorage instead of AsyncStorage directly for anything more than light usage since it operates globally.


1 Answers

This module (AsyncStorage) is not available on react-native-web : ^0.12.

If you need to use the AsyncStorage you can use the version: "react-native-web": "0.11.7",

PS: you can check updates on that subject at this issue: https://github.com/necolas/react-native-web/issues/1515

The official position is:

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

Regards

like image 184
Deivison Sporteman Avatar answered Oct 04 '22 13:10

Deivison Sporteman