Skip to content

[🐛] 🔥 remote-config: type mismatch between modular and namespaces onConfigUpdated #8613

@bennettp123

Description

@bennettp123

Issue

When switching onConfigUpdated to the modular export, it causes a type error on the callback:

Argument of type '(event: any, error: any) => Promise<void>' is not assignable to parameter of type '(config: ConfigValues) => void'.
  Target signature provides too few arguments. Expected 2 or more, but got 1. ts(2345)

Sample code:

import {
    getRemoteConfig,
    onConfigUpdated,
} from '@react-native-firebase/remote-config'

const remoteConfig = getRemoteConfig()

// deprecated, works fine
remoteConfig.onConfigUpdated((event, error) => {
    // ...
})

// type error
onConfigUpdated(remoteConfig, (event, error) => {
    // ...
})

Project Files

Javascript

Click To Expand

package.json:

{
  "name": "remote-config",
  "version": "1.0.0",
  "author": "Seven West Media",
  "private": true,
  "scripts": {
    "typecheck": "tsc",
    "test": "TZ=Australia/Perth jest"
  },
  "exports": {
    ".": "./src/index.ts",
    "./test": "./test/index.ts"
  },
  "peerDependencies": {
    "@react-native-firebase/remote-config": "^22.4.0",
    "emittery": "^1.0.3",
    "react": "^18.2.0",
    "storage": "*",
    "telemetry": "*",
    "zod": "^3.22.3"
  }
}

firebase.json for react-native-firebase v6:

{
    "$schema": "./node_modules/@react-native-firebase/app/firebase-schema.json",
    "react-native": {
        "app_data_collection_default_enabled": false,
        "app_log_level": "debug",
        "app_check_token_auto_refresh": false,
        "crashlytics_ndk_enabled": true,
        "crashlytics_debug_enabled": true,
        "crashlytics_disable_auto_disabler": true,
        "crashlytics_auto_collection_enabled": true,
        "crashlytics_is_error_generation_on_js_crash_enabled": true,
        "crashlytics_javascript_exception_handler_chaining_enabled": false,
        "messaging_auto_init_enabled": false,
        "messaging_android_headless_task_timeout": 30000,
        "messaging_android_notification_channel_id": "",
        "messaging_android_notification_color": "@color/hotpink",
        "messaging_ios_auto_register_for_remote_messages": true,
        "analytics_auto_collection_enabled": true,
        "analytics_collection_deactivated": false,
        "analytics_idfv_collection_enabled": false,
        "google_analytics_adid_collection_enabled": true,
        "google_analytics_ssaid_collection_enabled": true,
        "google_analytics_automatic_screen_reporting_enabled": false,
        "google_analytics_registration_with_ad_network_enabled": true,
        "analytics_default_allow_ad_personalization_signals": true,
        "perf_auto_collection_enabled": true,
        "perf_collection_deactivated": false,
        "in_app_messaging_auto_collection_enabled": false,
        "android_task_executor_maximum_pool_size": 1,
        "android_task_executor_keep_alive_seconds": 3,
        "android_bypass_emulator_url_remap": false
    }
}

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
N/A

AppDelegate.m:

N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

System:
  OS: macOS 26.0
  CPU: (12) arm64 Apple M2 Pro
  Memory: 90.45 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.0
    path: /var/folders/gt/ptf_r7hs7y3gw1mzqczbx78w0000gn/T/yarn--1752579192645-0.6109749599905343/node
  Yarn:
    version: 1.22.22
    path: /var/folders/gt/ptf_r7hs7y3gw1mzqczbx78w0000gn/T/yarn--1752579192645-0.6109749599905343/yarn
  npm:
    version: 10.7.0
    path: ~/.nodenv/versions/20.15.0/bin/npm
  Watchman:
    version: 2025.06.30.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/bennett/src/app-mono/vendor/bundle/ruby/3.3.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2412.12266719
  Xcode:
    version: 26.0/17A5276g
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /Users/bennett/.jenv/shims/javac
  Ruby:
    version: 3.3.2
    path: /Users/bennett/.rbenv/versions/3.3.2/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 22.4.0
  • Firebase module(s) you're using that has the issue:
    • @react-native-firebase/remote-config
  • Are you using TypeScript?

(feels weird using 🔥 for a type error lol)


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