-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
remoteConfig().getAll() return undefined is not an object (evaluating 'Object.keys(this._values)') #5854
Comments
We can reopen if you include version information as requested in the template you actively deleted |
Also if reproducible on current versions please include full stack trace thrown, these are all things you would need if someone brought the problem to you I believe |
These are my current versions list
|
Okay, I can see the problem. I'm going to increase validation in the effected area, but this is at heart a usage issue. It should not crash, but you are not using it correctly. Prior to calling getAll or getValue, you must set defaults, and fetchAndActivate, until then you may not assume there is anything useful in the config's internal state, and in fact it is uninitialized at the moment From our docs - https://rnfirebase.io/remote-config/usage#default-values
And then again a very prescriptive statement in the next chunk https://rnfirebase.io/remote-config/usage#fetch--activate
I am certain that will resolve your issue, and result in useful results so it will actually resolve the issue for you |
previously if you incorrectly called getAll before setting defaults or fetching any remote config, we would crash. Now we initialize values as an empty object, so we have a graceful failure confirmed via code inspection that this matches expecations from firebase-js-sdk https://github.com/firebase/firebase-js-sdk/blob/acc58102d4429ce0593ec22192e76018e9d16ed7/packages/remote-config/test/remote_config.test.ts#L333-L335 Fixes #5854
previously if you incorrectly called getAll before setting defaults or fetching any remote config, we would crash. Now we initialize values as an empty object, so we have a graceful failure confirmed via code inspection that this matches expecations from firebase-js-sdk https://github.com/firebase/firebase-js-sdk/blob/acc58102d4429ce0593ec22192e76018e9d16ed7/packages/remote-config/test/remote_config.test.ts#L333-L335 Fixes #5854
useEffect(() => {
getConfig()
.then(res => console.log(res)
.catch(err => console.log(err.message))
}, [])
const getConfig = async () => {
const firebase = await remoteConfig().getAll();
return firebase
}
It return undefined is not an object (evaluating 'Object.keys(this._values)')
The text was updated successfully, but these errors were encountered: