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

Ract-Native(0.59+) is missing AsyncStorage lib #3209

Closed
gilador opened this issue May 2, 2019 · 13 comments
Closed

Ract-Native(0.59+) is missing AsyncStorage lib #3209

gilador opened this issue May 2, 2019 · 13 comments
Assignees
Labels
needs-discussion Used for internal discussions React Native React Native related issue

Comments

@gilador
Copy link

gilador commented May 2, 2019

Describe the bug
while running my react-native app i get this:

Async Storage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/async-storage' instead of 'react-native'

it seems amplyfy-js is dependent on a no longer exiting dependencies such as AsyncStorage in react-native-0.59, e:g
node_modules/@aws-amplify/auth/lib/Auth.js:41 -> /node_modules/@aws amplify/core/lib/RNComponents/reactnative.js:18
image

To Reproduce
Steps to reproduce the behavior:

  1. build react-native app ()
  2. run on device
  3. connect to the react-native debugger
  4. See error in the log

Expected behavior
the code should not break over missing AsyncStorage

Smartphone:

  • Iphone 6
  • OS: 12.2
  • xcode 10.2.1

As i understand you use AsyncStorage as a fall back so i would suggest you to load that lib only if needed.

@manueliglesias manueliglesias added React Native React Native related issue needs-discussion Used for internal discussions labels May 2, 2019
@manueliglesias
Copy link
Contributor

Hi @gilador

Thank you for the report, we definitively need to discuss how we want to move forward when AsyncStorage is fully deprecated.

@GutteApps
Copy link

@manueliglesias we get this error even when providing our own storage class, do you know why?

@manueliglesias
Copy link
Contributor

@Gautierrr I think you are getting a warning (e.g. the yellowbox), is that correct? Once you dismiss it, the app should still work

@gilador
Copy link
Author

gilador commented May 3, 2019

It iw a warning but i cant dismiss it, its persistent

@gilador
Copy link
Author

gilador commented May 6, 2019

any thoughts?

@jessedoyle
Copy link
Contributor

jessedoyle commented May 8, 2019

@gilador - It's kludgy, but you can disable YellowBox notifications on a per-warning basis:

// probably in App.js
import { YellowBox } from 'react-native';

YellowBox.ignoreWarnings([
  'Async Storage has been extracted from react-native core and will be removed in a future release.',
]);

See the docs for more details.

@gilador
Copy link
Author

gilador commented May 12, 2019

10x, but its already disabled

@jessedoyle
Copy link
Contributor

@manueliglesias

Thank you for the report, we definitively need to discuss how we want to move forward when AsyncStorage is fully deprecated.

Should this discussion begin now?

What do you think about providing a dependency injection pattern via the configuration?

i.e.

import MyAsyncStorage from '@react-native-community/async-storage';

Amplify.configure({
  ...
  Dependencies: {
    AsyncStorage: MyAsyncStorage, // would default to react-native provided AsyncStorage
  },
  ...
});

This could also make unit testing trivial as a reasonable double could be provided for hard dependencies during test runs.

@undefobj
Copy link
Contributor

@manueliglesias and I are taking a longer look at our storage capabilities right now, including offline features, and will look at this as part of that effort. I don't have an ETA on when we'll have a new recommendation but will look at the suggestions above.

@stale
Copy link

stale bot commented Jun 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.

@stale stale bot closed this as completed Jun 29, 2019
@dilantha111
Copy link

well I guess we need to open this again,
I tried this one, but it didn't work,

import MyAsyncStorage from '@react-native-community/async-storage';

Amplify.configure({
  ...
  Dependencies: {
    AsyncStorage: MyAsyncStorage, // would default to react-native provided AsyncStorage
  },
  ...
});
```

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-discussion Used for internal discussions React Native React Native related issue
Projects
None yet
Development

No branches or pull requests

6 participants