jasonmerino / react-native-simple-store

A minimalistic wrapper around React Native's AsyncStorage.

Home Page:https://www.npmjs.com/package/react-native-simple-store

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to resolve module `@react-native-community/async-storage`

maryasdk opened this issue · comments

Hi,
I just updated to react-native 0.59.8 from 0.58.
I updated as well to react-native-simple-storage from 1.3.0 to 2.0.0 to remove the warning regarding async-storage.

I am getting the following error on runtime:
Unable to resolve module @react-native-community/async-storage from /Users/maryasadek/RN/Washmen/node_modules/react-native-simple-store/dist/index.js: Module @react-native-community/async-storage does not exist in the Haste module map

I tried resetting node modules, and the cache, but it did not help.
image

Hey @maryasdk,

Sorry to hear you are having trouble. Did you run the command to link the new async-storage module in your project?

react-native link @react-native-community/async-storage

There are some installation instructions in the README calling this out.

If you have run link, or run it and still have trouble, please feel free to comment back here. :)

Thank you for your fast response @jasonmerino

Linking fails with the message: Failed to get dependency config.

Below is the verbose error message.
Note: that I do not use async storage in my app independently of simple-store

image

commented

@maryasdk you should install the @react-native-community/async-storage before link
when I install the @react-native-community/async-storage, it's works to me

@duzliang I did not try to do so. I thought that it should be downloaded by the simple-store library since it is a dependency of the library itself. I guess I'll do it ur way, if there isnt an update to fix the issue soon. Thanks

It looks like @react-native-community/async-storage was only added as a devDependency. :/

I'll look into adding that as a normal dependency and see if I can add in the linking step as a postinstall script so that part of the setup isn't needed anymore.

Okay thanks @jasonmerino waiting for your update