Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

After Installing Error : _reactNative.AsyncStorage.getItem(..).then(..).done is not a function #173

Closed
nilaybrahmbhatt opened this issue Jul 15, 2017 · 8 comments

Comments

@nilaybrahmbhatt
Copy link

hi,

after installing and link this , i got AsyncStorage error,

_reactNative.AsyncStorage.getItem(..).then(..).done is not a function

React-native version : latest

@marzolfb
Copy link
Contributor

This seems to have nothing to do with this library. When you say "latest" for react-native version, what version is that specifically? Are you able to build/run the included example app just fine? If so, do you want to compare how you are setup with your own app and compare it to the example app that works fine?

@sehranhas
Copy link

I have the same issue. I wasn't able to run the example app either. Is this library compatible with react native v0.49.2?

@sehranhas
Copy link

@nilaybrahmbhatt found the problem just remove the .done() part

@phillbaker
Copy link

phillbaker commented Nov 21, 2017

I believe this actually is an issue with react-native-pathjs-charts. After requiring/importing an element (e.g. import { SmoothLine } from 'react-native-pathjs-charts'), Promise.prototype.done becomes undefined. Commenting out the import leads to the built-in react-native promise coming back (which does define done).

I think it's related to the babel-polyfill introduced in #85, looking at the docs I'm guessing that babel-polyfill overrides the react native global promise object with its own.

This seems related to #195 and #202.

Looking at #62, would it be possible to just include a polyfill for the missing Symbol class instead of all of babel-polyfill?

@phillbaker
Copy link

It looks like an alternative solution to #62 might be:

// index.android.js
import 'core-js/es6/symbol';
import 'core-js/fn/symbol/iterator';

Note that the other issues linked to in that comment have been fixed in facebook/react-native@165b38a.

@marzolfb
Copy link
Contributor

Thank you very much @phillbaker - your feedback/solution was very helpful in addressing this issue. I'll try to get #211 merged in and published to npm in the next 2-3 days.

@phillbaker
Copy link

phillbaker commented Nov 26, 2017 via email

@marzolfb
Copy link
Contributor

Closing now that #211 has been merged into master

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

No branches or pull requests

4 participants