You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Remote Config] Signature mismatch for onConfigUpdate between implementation and TypeScript types
There is a discrepancy between the JavaScript implementation of onConfigUpdate and its corresponding TypeScript declaration in the @react-native-firebase/remote-config package.
The JS implementation (in index.js) expects a single argument: observer.
The TS definition (in index.d.ts) expects two arguments: remoteConfig and observer.
This causes a compilation error for TypeScript users. If a user follows the TS definition and passes two arguments, the JS code receives the remoteConfig instance as the observer argument. Since the remoteConfig instance lacks the required .next and .error functions, the library throws a runtime error: "'observer' expected an object with 'next' and 'error' functions."
// Line 251onConfigUpdate(observer){if(!isObject(observer)||!isFunction(observer.next)||!isFunction(observer.error)){thrownewError("'observer' expected an object with 'next' and 'error' functions.");}// ...}
Issue
[Remote Config] Signature mismatch for
onConfigUpdatebetween implementation and TypeScript typesThere is a discrepancy between the JavaScript implementation of
onConfigUpdateand its corresponding TypeScript declaration in the@react-native-firebase/remote-configpackage.index.js) expects a single argument:observer.index.d.ts) expects two arguments:remoteConfigandobserver.This causes a compilation error for TypeScript users. If a user follows the TS definition and passes two arguments, the JS code receives the
remoteConfiginstance as theobserverargument. Since theremoteConfiginstance lacks the required.nextand.errorfunctions, the library throws a runtime error:"'observer' expected an object with 'next' and 'error' functions."Project Files
Javascript
Click To Expand
packages/remote-config/lib/index.js(Implementation):packages/remote-config/lib/index.d.ts(Type Definition):firebase.jsonfor react-native-firebase v6:{}iOS
Click To Expand
N/A - This is a cross-platform TypeScript/JavaScript definition issue.
Android
Click To Expand
N/A - This is a cross-platform TypeScript/JavaScript definition issue.
Environment
Click To Expand
react-native infooutput:Platform that you're experiencing the issue on:
Both
react-native-firebaseversion you're using that has this issue:23.8.2Firebasemodule(s) you're using that has the issue:Remote ConfigAre you using
TypeScript?Yes