Closed ZachCurtis closed 6 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
Is it possible to reopen this bug? We are facing a similar issue. (react-native 0.51)
We eliminated this issue in our RN codebase at comma.ai by ensuring we never setItem(key, null).
Not sure if this qualifies as a bug given the AsyncStorage.setItem is documented to expect a non-null string value parameter.
still a problem on setItem on existing key
I am having this exact same issue. I already check that the value being stored isn't null
Same here. It works fine when loading build in expo but fails in TestFlight. Values are empty strings.
I am having this same issue while storing a json file in the async and then using it later. Is there any way to get past this
same issue as @niraj002 . I can't store json. Throws the same error
The issue is still present.
Issue still present
Issue still present.
Facing the same issue. Anyone can help?
I am experiencing the same issue!
For anyone still experiencing the same problem, check all parameters being password to the setItem method. An example of where the problem could occur would be calling a reducer from another reducer. A mistake would be to access a payload's prop inside the first reducer and then attempt to access a non-existent prop within the reducer being called.
@ZachCurtis You are calling the replaceLocal function with one parameter when it requires two. If you console.log(newObj), you will see that it is undefined.
hi,
using JSON.stringify(value) solved my problem.
AsyncStorage.setItem("myKey", JSON.stringify("myValue"));
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: Win 10 1703 OS Build: 15063.674 Node: 4.6.1 Yarn: -- npm: 5.5.1 Watchman: -- Xcode: -- Android Studio: --
Target Platform: iOS (11)
Steps to Reproduce
NSNull unhandled exception leading to total application crash when attempting to call AsyncStorage.setItem('justAString').
Cannot try/catch/finally to prevent crash, suggest adding exception handler.
Expected Behavior
An error message should have been thrown with the promise associated with setItem.
Actual Behavior
Expo displays this exception and stack trace for less than a second before crashing the Expo instance.
Reproducible Demo