Skip to content

[🐛] [Remote Config 🔥 ] Signature mismatch for onConfigUpdate in types #8838

@d4n13l-4lf4

Description

@d4n13l-4lf4

Issue

[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."


Project Files

Javascript

Click To Expand

packages/remote-config/lib/index.js (Implementation):

// Line 251
onConfigUpdate(observer) {
  if (!isObject(observer) || !isFunction(observer.next) || !isFunction(observer.error)) {
    throw new Error("'observer' expected an object with 'next' and 'error' functions.");
  }
  // ...
}

packages/remote-config/lib/index.d.ts (Type Definition):

// Line 435
onConfigUpdate(remoteConfig: RemoteConfig, observer: ConfigUpdateObserver): Unsubscribe;

firebase.json for 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 info output:

System:
  OS: macOS 26.1
  CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
  Memory: 59.94 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: /Users/REDACTED/.nvm/versions/node/v20.11.0/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /Users/REDACTED/.nvm/versions/node/v20.11.0/bin/npm
  Watchman:
    version: 2026.01.12.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.27397.103.2522.14617522
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.21
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.9
    wanted: 0.76.9
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

  • Platform that you're experiencing the issue on:

  • Both

  • react-native-firebase version you're using that has this issue:

  • 23.8.2

  • Firebase module(s) you're using that has the issue:

  • Remote Config

  • Are you using TypeScript?

  • Yes


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions