Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncStorage module not found. Can't resolve react-native-web/dist/exports/AsyncStorage #1515

Closed
Sharathnasa opened this issue Jan 3, 2020 · 8 comments

Comments

@Sharathnasa
Copy link

Hi Team,

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

Regards,
Sharath

@Naturalclar
Copy link

@Sharathnasa
AsyncStorage will be removed in v0.12 of react-native-web
Seems like it will be supported in v2 of react-native-community/async-storage, which can be found here

@Sharathnasa
Copy link
Author

@Naturalclar Thank yo so much for the reply. So how do i go about fixing my current issue? Could you please shed some light

@necolas
Copy link
Owner

necolas commented Jan 3, 2020

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

@aguilared
Copy link

"react-native-web": "~0.13.7",
AsyncStorage not available in RNW 0.13.7 expo/expo#6654
Module not found: Can't resolve 'react-native-web/dist/exports/AsyncStorage

@EvanBacon
Copy link
Contributor

AsyncStorage is still deprecated. In Expo SDK 39 we use react-native-web@0.13 so you'll need to migrate to the react-native-community module. ymmv with web support in community packages.

@DaveLomber
Copy link

DaveLomber commented Jan 22, 2021

I use

  • "react-native-web": "^0.14.10",
  • "@react-native-async-storage/async-storage": "1.13.3",

and still getting Attempted import error: 'AsyncStorage' is not exported from 'react-native'.

murillo94 added a commit to murillo94/expo that referenced this issue Jan 29, 2021
# Why
After hours trying to run `react-native-web` with the latest expo sdk v40 I discovery the [docs](https://docs.expo.io/guides/running-in-the-browser/#adding-web-support-to-expo-projects) are outdated. Expo recommends to install `react-native-web@~0.11` but with expo sdk v40 not work.

# How
- Add text to explain how to run on higher expo sdk v39 according this issue [here] as @EvanBacon recommends (necolas/react-native-web#1515 (comment))

# Test Plan
N/A
@aneena-thomas
Copy link

aneena-thomas commented Mar 25, 2022

Any update regarding this error? I'm on "react-native-web": "0.17.1", and still got the same error.

"export 'AsyncStorage' was not found in 'react-native-web/dist/index'

any help @necolas

@akashhdev
Copy link

For anyone still facing this, I fixed this by changing the import of AsyncStorage

from: import AsyncStorage from "react-native";
to: import AsyncStorage from "@react-native-async-storage/async-storage";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants