Error being thrown when calling getItem and resolve within function is called.
This started happening randomly and I cannot seem to figure out why. Whenever get item is called this error is being thrown.
You attempted to set the key `_65` with the value `1` on an object that is meant to be immutable and has been frozen.
I should be expecting it to return a stored item without this error.
I have not figured out how to repro it as I've never had this error before, I don't even know if it is directly related I am just following the logs at this point.
getItem to a large storage item?debug-local from the requested storage key, which is also debug-local.ExceptionsManager.js:86 You attempted to set the key '_65' with the value '1' on an object that is meant to be immutable and has been frozen.
- <unknown>: AsyncStorage.js:86:10
To get around it I am just doing this:
if (value) {
resolve(value);
}
As that seems to work for now.
It seems that the value is returning null and is breaking only on this specific call from debug-local haven't seen that before.
Hey @mikehuebner ,
Yeah, that'd be a taught one to solve without repro steps. Maybe you're trying to save a data that's returned from some kind of third-party API (and that data is indeed frozen?)
@mikehuebner Any update on this?
@Krizzu Apologies on not getting an update sooner, been busy with other projects. But the ending solution ended up being modifying the keys async-storage was saving. I can't remember off the top of my head but it was another package that was trying to save a key within storage that just wasn't correct. Took me a while to figure out which key it was modifying but was easy once I figured that out. If anyone else has a problem similar to this I'll add more on how I fixed it.
For anyone else seeing this error I was also getting it when using this library with redux-persist, and accidentally trying to store a promise in my store.
i was getting this error as well because i was as @CatapultJesse says, storing a promise. All i had to do was put a .then(value => {Asyncstorage.setitem()}) .
I'm getting this with:
await AsyncStorage.setItem("settings", "{"hasAskedForLocationPermission":true,"hasAskedForNotificationsPermission":true,"hasOptedForNotifications":false}")

Hey you see values like _65, it means that you used Promise as value. Try to find if there's a place in code where you forgot to await a value
I figured out the issue. It had nothing to do with async-storage, though. Yes, I hadn't awaited a promise, but it was only a problem when I used it as a property in Segment.trackWithProperties(event, updatedProperties) using expo-analytics-segment. Might be useful for anyone else who gets this problem. I always log before tracking in the console, but it wasn't easy to track down because I don't await tracking to Segment so that it doesn't slow down the app. This was confusing.