invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.53k stars 2.18k forks source link

🔥 TypeScript errors #2614

Closed jasperkuperus closed 3 years ago

jasperkuperus commented 4 years ago

Issue

I'm testing the Authentication part of v6. Functionally it works well, but I do get TypeScript errors when I run yarn tsc:

node_modules/@react-native-firebase/app/lib/index.d.ts:395:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

395   export default module;
      ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1179:9 - error TS1095: A 'set' accessor cannot have a return type annotation.

1179     set languageCode(code: string): void;
             ~~~~~~~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1589:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1589   import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
       ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1590:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1590   import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
       ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1593:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1593   export const firebase = firebaseNamedExport;
                               ~~~~~~~~~~~~~~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1596:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

1596   export default module;
       ~~~~~~

Found 6 errors.

For now, I'm hiding lib errors using yarn tsc --skipLibCheck, but I'd rather not use the --skipLibCheck of course.


Project Files

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' target 'promo' do # Pods for promo pod 'React', :path => '../node_modules/react-native/' pod 'React-Core', :path => '../node_modules/react-native/React' pod 'React-DevSupport', :path => '../node_modules/react-native/React' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' target 'promoTests' do inherit! :search_paths # Pods for testing end use_native_modules! end target 'promo-tvOS' do # Pods for promo-tvOS target 'promo-tvOSTests' do inherit! :search_paths # Pods for testing end end ``` #### `AppDelegate.m`: ```objc /** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ @import Firebase; #import "AppDelegate.h" #import #import #import #import "RNSplashScreen.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"promo" initialProperties:nil]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; // Show splash screen, make sure that JavaScript fully loads [RNSplashScreen show]; return YES; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } @end ```


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`: ```groovy // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "28.0.3" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 28 supportLibVersion = "28.0.0" } repositories { google() jcenter() } dependencies { classpath("com.android.tools.build:gradle:3.4.1") classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } google() jcenter() } } ``` #### `android/app/build.gradle`: ```groovy apply plugin: "com.android.application" import com.android.build.OutputFile /** * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle * bundleAssetName: "index.android.bundle", * * // the entry file for bundle generation * entryFile: "index.android.js", * * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode * bundleInDebug: false, * * // whether to bundle JS and assets in release mode * bundleInRelease: true, * * // whether to bundle JS and assets in another build variant (if configured). * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants * // The configuration property can be in the following formats * // 'bundleIn${productFlavor}${buildType}' * // 'bundleIn${buildType}' * // bundleInFreeDebug: true, * // bundleInPaidRelease: true, * // bundleInBeta: true, * * // whether to disable dev mode in custom build variants (by default only disabled in release) * // for example: to disable dev mode in the staging build type (if configured) * devDisabledInStaging: true, * // The configuration property can be in the following formats * // 'devDisabledIn${productFlavor}${buildType}' * // 'devDisabledIn${buildType}' * * // the root of your project, i.e. where "package.json" lives * root: "../../", * * // where to put the JS bundle asset in debug mode * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", * * // where to put the JS bundle asset in release mode * jsBundleDirRelease: "$buildDir/intermediates/assets/release", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in debug mode * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", * * // where to put drawable resources / React Native assets, e.g. the ones you use via * // require('./image.png')), in release mode * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", * * // by default the gradle tasks are skipped if none of the JS files or assets change; this means * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. * inputExcludes: ["android/**", "ios/**"], * * // override which node gets called and with what additional arguments * nodeExecutableAndArgs: ["node"], * * // supply additional arguments to the packager * extraPackagerArgs: [] * ] */ project.ext.react = [ entryFile: "index.js", enableHermes: false, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: * - An APK that only works on ARM devices * - An APK that only works on x86 devices * The advantage is the size of the APK is reduced by about 4MB. * Upload all the APKs to the Play Store and people will download * the correct one based on the CPU architecture of their device. */ def enableSeparateBuildPerCPUArchitecture = false /** * Run Proguard to shrink the Java bytecode in release builds. */ def enableProguardInReleaseBuilds = false /** * The preferred build flavor of JavaScriptCore. * * For example, to use the international variant, you can use: * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` * * The international variant includes ICU i18n library and necessary data * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that * give correct results when using with locales other than en-US. Note that * this variant is about 6MiB larger per architecture than default. */ def jscFlavor = 'org.webkit:android-jsc:+' /** * Whether to enable the Hermes VM. * * This should be set on project.ext.react and mirrored here. If it is not set * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode * and the benefits of using Hermes will therefore be sharply reduced. */ def enableHermes = project.ext.react.get("enableHermes", false); android { compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "nl.qscope.promo" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } } buildTypes { debug { signingConfig signingConfigs.debug } release { // Caution! In production, you need to generate your own keystore file. // see https://facebook.github.io/react-native/docs/signed-apk-android. signingConfig signingConfigs.debug minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> // For each separate APK per architecture, set a unique version code as described here: // https://developer.android.com/studio/build/configure-apk-splits.html def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } } } packagingOptions { pickFirst '**/armeabi-v7a/libc++_shared.so' pickFirst '**/x86/libc++_shared.so' pickFirst '**/arm64-v8a/libc++_shared.so' pickFirst '**/x86_64/libc++_shared.so' pickFirst '**/x86/libjsc.so' pickFirst '**/armeabi-v7a/libjsc.so' } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.facebook.react:react-native:+" // From node_modules implementation 'androidx.appcompat:appcompat:1.1.0-rc01' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' if (enableHermes) { def hermesPath = "../../node_modules/hermesvm/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } } // Run this once to be able to run the application with BUCK // puts all compile dependencies into folder libs for BUCK to use task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) apply plugin: 'com.google.gms.google-services' ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'promo' apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' ``` #### `MainApplication.java`: ```java package nl.qscope.promo; import android.app.Application; import android.util.Log; import com.facebook.react.PackageList; import com.facebook.hermes.reactexecutor.HermesExecutorFactory; import com.facebook.react.bridge.JavaScriptExecutorFactory; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } } ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` System: OS: macOS 10.14.5 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 5.14 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.10.0 - ~/.nvm/versions/node/v12.10.0/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.10.3 - ~/.nvm/versions/node/v12.10.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.8.6 => 16.8.6 react-native: 0.60.5 => 0.60.5 ``` - **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 - [x] Both - **`react-native-firebase` version you're using that has this issue:** - 0.60.5 - **`Firebase` module(s) you're using that has the issue:** - Authentication - **Are you using `TypeScript`?** - `Yes`

Salakar commented 4 years ago

Could you try 0.5.3 of the pre-release packages please? I think these were fixed?

cc @IljaDaderko

jasperkuperus commented 4 years ago

Tried both 0.5.3 and 0.5.4. Still got errors, somewhat different though:

node_modules/@react-native-firebase/app/lib/index.d.ts:395:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

395   export default module;
      ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1589:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1589   import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
       ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1590:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1590   import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
       ~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1593:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1593   export const firebase = firebaseNamedExport;
                               ~~~~~~~~~~~~~~~~~~~

node_modules/@react-native-firebase/auth/lib/index.d.ts:1596:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

1596   export default module;
       ~~~~~~

Found 5 errors.

(These are the errors for 0.5.4)

xzilja commented 4 years ago

@Salakar No, this is new to me as well. Will need to take another look. At first glance it looks like ts is highlighting "semantic" errors i.e. no imports in declarations etc...

Salakar commented 4 years ago

Weird, not sure why it doesn't show up in any of our typescript tests or validations though 🤔

Ehesp commented 4 years ago

Just tried locally, all seems to be passing now with latest updates.

radko93 commented 4 years ago

I get similar errors somehow on 6.0.3 but it's hard to say why (I checked on both 3.6.4 and 3.5.3 TS versions). I get this both on a local machine and on CI so it's not any kind of cache.

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1350:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1350   import { ReactNativeFirebase } from '@react-native-firebase/app';
       ~~~~~~

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1351:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1351   import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
       ~~~~~~

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1352:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

1352   import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
       ~~~~~~

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1355:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

1355   export const firebase = firebaseNamedExport;
                               ~~~~~~~~~~~~~~~~~~~

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1361:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

1361   export default defaultExport;
       ~~~~~~

node_modules/@react-native-firebase/analytics/lib/index.d.ts:1383:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

1383 namespace ReactNativeFirebase {
     ~~~~~~~~~

node_modules/@react-native-firebase/app/lib/index.d.ts:395:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

my tsConfig:

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "isolatedModules": true,
    "noUnusedLocals": true,
    "jsx": "react-native",
    "lib": [
      "esnext"
    ],
    "moduleResolution": "node",
    "noEmit": true,
    "strict": true,
    "target": "esnext",
    "resolveJsonModule": true,
    "types": [
      "node",
      "jest"
    ],
    "downlevelIteration": true
  },
  "include": [
    "packages/[redacted]/src/**/*",
    "packages/[redacted]/__mocks__/**/*",
    "packages/[redacted]/**/*"
  ],
  "exclude": [
    "node_modules",
    "babel.config.js",
    "metro.config.js",
    "jest.config.js"
  ]
}

@IljaDaderko

Salakar commented 4 years ago

Also tracking in https://github.com/invertase/react-native-firebase/issues/2732 - have confirmed it's an issue on all modules. Unfortunately the fix requires a substantial change to all the type definitions so tracking this for 6.1.0.

Frustratingly it didn't show up on any of our tests before we released v6 because of a single tsconfig.json option 😫 but we can reproduce now

jerameel commented 4 years ago

this happened to me after migrating from v5 - v6.

i just added this line to tsconfig.json to please my pipelines but i dont think that this is an actual fix "skipLibCheck": true

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

rszalski commented 4 years ago

This is still a problem for me, even after upgrading to v6.2.0 of the following Firebase libs:

    "@react-native-firebase/app": "6.2.0",
    "@react-native-firebase/dynamic-links": "6.2.0",

This is the tsc result:

node_modules/@react-native-firebase/app/lib/index.d.ts:395:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

395   export default module;
      ~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:562:22 - error TS2315: Type 'Function' is not generic.

562     onLink(listener: Function<DynamicLink>): Function;
                         ~~~~~~~~~~~~~~~~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:568:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

568   import { ReactNativeFirebase } from '@react-native-firebase/app';
      ~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:569:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

569   import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
      ~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:570:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module.

570   import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
      ~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:573:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.

573   export const firebase = firebaseNamedExport;
                              ~~~~~~~~~~~~~~~~~~~

node_modules/@react-native-firebase/dynamic-links/lib/index.d.ts:579:3 - error TS2666: Exports and export assignments are not permitted in module augmentations.

579   export default defaultExport;
      ~~~~~~

node_modules/@types/react-native/index.d.ts:8916:9 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'require' must be of type 'Require', but here has type 'NodeRequire'.

8916     var require: NodeRequire;

Running TypeScript v3.7.4. The "skipLibCheck": true workaround "works" but I'd rather leave it disabled.

Ehesp commented 4 years ago

Yeah apologies, we still need to get around to fixing these. It was a derp on our end during development and we didn't have these issues flagging 😭

rszalski commented 4 years ago

No need to apologize. I wasn’t trying to exert pressure or anything, just fending off the stale bot :D

If you need more details to investigate this let me know.

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

rszalski commented 4 years ago

@stale Don't close this just yet

punksta commented 4 years ago

having same issue with

    "@react-native-firebase/analytics": "^6.2.0",
    "@react-native-firebase/app": "^6.2.0",
    "@react-native-firebase/perf": "^6.2.0",
"typescript": "^3.7.2"
stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

punksta commented 4 years ago

still valid. 6.3.0

almeynman commented 4 years ago

Is there any workaround for now?

mfitzhenry commented 4 years ago

@almeynman yes, see @jerameel comment above.

add: "skipLibCheck": true to tsconfig.json

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

punksta commented 4 years ago

still valid

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

kossnocorp commented 4 years ago

I can confirm that this issue is still present.

mikehardy commented 4 years ago

GIven the frequent staleness, anyone have a PR? That would help move it along

stale[bot] commented 4 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

punksta commented 4 years ago

it's still valid

stale[bot] commented 3 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

CyxouD commented 3 years ago

Still issue to me for @react-native-firebase/dynamic-links

image

stale[bot] commented 3 years ago

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

sebastian-e-vogel commented 3 years ago

Still issue to me for @react-native-firebase/dynamic-links

mikehardy commented 3 years ago

This clearly needs some community help as it's sat stale for a while. We would welcome any PRs that addressed the errors/warnings seen

Salakar commented 3 years ago

Yes please 🙏 PRs would be welcome

mikehardy commented 3 years ago

We happily accept types PRs #3810 is an example If someone generates one, there will even be an "artifact" on the top-right-ish of the Action "Create Test Patches" which others can try, to validate. We will need to the community to drive this, all the available Invertase resources are booked for quite a while as there is paying work (true! it exists) and then after that there is a big backlog of changed / new functionality in the upstream APIs to cover, a mch higher priority than types

mattlubner commented 3 years ago

Why does this issue have [v6] in the name? It's still a problem on the latest versions of @react-native-firebase/* packages.

Specifically, as of this comment, these packages/versions:

mikehardy commented 3 years ago

Because it was originally logged when v5 and v6 were co-existing. It's a historical context, nothing semantically useful anymore

mattlubner commented 3 years ago

The entire list of type declaration conflicts can be seen by making these changes to the monrepo's tsconfig.json:

-    "skipLibCheck": true,
+    "skipLibCheck": false,
     "experimentalDecorators": true,
     "emitDecoratorMetadata": true,
-    "lib": ["es2015", "es2016", "esnext", "dom"]
+    "lib": ["es2015", "es2016", "esnext"]

Removing dom just hides type conflicts between typescript/lib/lib.dom.d.ts and @types/react-native; those conflicts are unrelated to this issue.

Here's the full list of type conflicts between the packages in this monorepo (as of commit 55cd752f) ```sh yarn run v1.22.4 $ tsc --project . packages/admob/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:401:11 - error TS2713: Cannot access 'AdsConsentDebugGeography.DISABLED' because 'AdsConsentDebugGeography' is a type, but not a namespace. Did you mean to retrieve the type of the property 'DISABLED' in 'AdsConsentDebugGeography' with 'AdsConsentDebugGeography["DISABLED"]'? 401 | AdsConsentDebugGeography.DISABLED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:402:11 - error TS2713: Cannot access 'AdsConsentDebugGeography.EEA' because 'AdsConsentDebugGeography' is a type, but not a namespace. Did you mean to retrieve the type of the property 'EEA' in 'AdsConsentDebugGeography' with 'AdsConsentDebugGeography["EEA"]'? 402 | AdsConsentDebugGeography.EEA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:403:11 - error TS2713: Cannot access 'AdsConsentDebugGeography.NOT_EEA' because 'AdsConsentDebugGeography' is a type, but not a namespace. Did you mean to retrieve the type of the property 'NOT_EEA' in 'AdsConsentDebugGeography' with 'AdsConsentDebugGeography["NOT_EEA"]'? 403 | AdsConsentDebugGeography.NOT_EEA, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:427:11 - error TS2713: Cannot access 'AdsConsentStatus.UNKNOWN' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'UNKNOWN' in 'AdsConsentStatus' with 'AdsConsentStatus["UNKNOWN"]'? 427 | AdsConsentStatus.UNKNOWN ~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:428:11 - error TS2713: Cannot access 'AdsConsentStatus.NON_PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'NON_PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["NON_PERSONALIZED"]'? 428 | AdsConsentStatus.NON_PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:429:11 - error TS2713: Cannot access 'AdsConsentStatus.PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["PERSONALIZED"]'? 429 | AdsConsentStatus.PERSONALIZED, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:446:7 - error TS2713: Cannot access 'AdsConsentStatus.UNKNOWN' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'UNKNOWN' in 'AdsConsentStatus' with 'AdsConsentStatus["UNKNOWN"]'? 446 AdsConsentStatus.UNKNOWN | AdsConsentStatus.NON_PERSONALIZED | AdsConsentStatus.PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:446:34 - error TS2713: Cannot access 'AdsConsentStatus.NON_PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'NON_PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["NON_PERSONALIZED"]'? 446 AdsConsentStatus.UNKNOWN | AdsConsentStatus.NON_PERSONALIZED | AdsConsentStatus.PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:446:70 - error TS2713: Cannot access 'AdsConsentStatus.PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["PERSONALIZED"]'? 446 AdsConsentStatus.UNKNOWN | AdsConsentStatus.NON_PERSONALIZED | AdsConsentStatus.PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:540:9 - error TS2713: Cannot access 'AdsConsentStatus.UNKNOWN' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'UNKNOWN' in 'AdsConsentStatus' with 'AdsConsentStatus["UNKNOWN"]'? 540 | AdsConsentStatus.UNKNOWN ~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:541:9 - error TS2713: Cannot access 'AdsConsentStatus.NON_PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'NON_PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["NON_PERSONALIZED"]'? 541 | AdsConsentStatus.NON_PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:542:9 - error TS2713: Cannot access 'AdsConsentStatus.PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["PERSONALIZED"]'? 542 | AdsConsentStatus.PERSONALIZED; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:562:9 - error TS2713: Cannot access 'AdsConsentStatus.UNKNOWN' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'UNKNOWN' in 'AdsConsentStatus' with 'AdsConsentStatus["UNKNOWN"]'? 562 | AdsConsentStatus.UNKNOWN ~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:563:9 - error TS2713: Cannot access 'AdsConsentStatus.NON_PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'NON_PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["NON_PERSONALIZED"]'? 563 | AdsConsentStatus.NON_PERSONALIZED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:564:9 - error TS2713: Cannot access 'AdsConsentStatus.PERSONALIZED' because 'AdsConsentStatus' is a type, but not a namespace. Did you mean to retrieve the type of the property 'PERSONALIZED' in 'AdsConsentStatus' with 'AdsConsentStatus["PERSONALIZED"]'? 564 | AdsConsentStatus.PERSONALIZED; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:771:9 - error TS2713: Cannot access 'MaxAdContentRating.G' because 'MaxAdContentRating' is a type, but not a namespace. Did you mean to retrieve the type of the property 'G' in 'MaxAdContentRating' with 'MaxAdContentRating["G"]'? 771 | MaxAdContentRating.G ~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:772:9 - error TS2713: Cannot access 'MaxAdContentRating.PG' because 'MaxAdContentRating' is a type, but not a namespace. Did you mean to retrieve the type of the property 'PG' in 'MaxAdContentRating' with 'MaxAdContentRating["PG"]'? 772 | MaxAdContentRating.PG ~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:773:9 - error TS2713: Cannot access 'MaxAdContentRating.T' because 'MaxAdContentRating' is a type, but not a namespace. Did you mean to retrieve the type of the property 'T' in 'MaxAdContentRating' with 'MaxAdContentRating["T"]'? 773 | MaxAdContentRating.T ~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:774:9 - error TS2713: Cannot access 'MaxAdContentRating.MA' because 'MaxAdContentRating' is a type, but not a namespace. Did you mean to retrieve the type of the property 'MA' in 'MaxAdContentRating' with 'MaxAdContentRating["MA"]'? 774 | MaxAdContentRating.MA; ~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:846:9 - error TS2713: Cannot access 'AdEventType.LOADED' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'LOADED' in 'AdEventType' with 'AdEventType["LOADED"]'? 846 | AdEventType.LOADED ~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:847:9 - error TS2713: Cannot access 'AdEventType.ERROR' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'ERROR' in 'AdEventType' with 'AdEventType["ERROR"]'? 847 | AdEventType.ERROR ~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:848:9 - error TS2713: Cannot access 'AdEventType.OPENED' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'OPENED' in 'AdEventType' with 'AdEventType["OPENED"]'? 848 | AdEventType.OPENED ~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:849:9 - error TS2713: Cannot access 'AdEventType.CLICKED' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'CLICKED' in 'AdEventType' with 'AdEventType["CLICKED"]'? 849 | AdEventType.CLICKED ~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:850:9 - error TS2713: Cannot access 'AdEventType.LEFT_APPLICATION' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'LEFT_APPLICATION' in 'AdEventType' with 'AdEventType["LEFT_APPLICATION"]'? 850 | AdEventType.LEFT_APPLICATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:851:9 - error TS2713: Cannot access 'AdEventType.CLOSED' because 'AdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'CLOSED' in 'AdEventType' with 'AdEventType["CLOSED"]'? 851 | AdEventType.CLOSED ~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:852:9 - error TS2713: Cannot access 'RewardedAdEventType.LOADED' because 'RewardedAdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'LOADED' in 'RewardedAdEventType' with 'RewardedAdEventType["LOADED"]'? 852 | RewardedAdEventType.LOADED ~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:853:9 - error TS2713: Cannot access 'RewardedAdEventType.EARNED_REWARD' because 'RewardedAdEventType' is a type, but not a namespace. Did you mean to retrieve the type of the property 'EARNED_REWARD' in 'RewardedAdEventType' with 'RewardedAdEventType["EARNED_REWARD"]'? 853 | RewardedAdEventType.EARNED_REWARD, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:1185:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1185 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/admob/lib/index.d.ts:1186:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1186 import React from 'react'; ~~~~~~ packages/admob/lib/index.d.ts:1186:21 - error TS2307: Cannot find module 'react' or its corresponding type declarations. 1186 import React from 'react'; ~~~~~~~ packages/admob/lib/index.d.ts:1187:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1187 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/admob/lib/index.d.ts:1188:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1188 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/admob/lib/index.d.ts:1189:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1189 import BannerAd = FirebaseAdMobTypes.BannerAd; ~~~~~~ packages/admob/lib/index.d.ts:1192:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1192 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/admob/lib/index.d.ts:1210:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1210 export default defaultExport; ~~~~~~ packages/admob/lib/index.d.ts:1230:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 1230 namespace ReactNativeFirebase { ~~~~~~~~~ packages/analytics/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/analytics/lib/index.d.ts:1265:34 - error TS2304: Cannot find name 'SetCheckoutOptionEventParameters'. 1265 logSetCheckoutOption(params: SetCheckoutOptionEventParameters): Promise; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/analytics/lib/index.d.ts:1485:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1485 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/analytics/lib/index.d.ts:1486:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1486 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/analytics/lib/index.d.ts:1487:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1487 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/analytics/lib/index.d.ts:1490:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1490 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/analytics/lib/index.d.ts:1496:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1496 export default defaultExport; ~~~~~~ packages/analytics/lib/index.d.ts:1518:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 1518 namespace ReactNativeFirebase { ~~~~~~~~~ packages/app/lib/index.d.ts:549:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 549 export default module; ~~~~~~ packages/auth/lib/index.d.ts:1639:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1639 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/auth/lib/index.d.ts:1640:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1640 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/auth/lib/index.d.ts:1641:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1641 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/auth/lib/index.d.ts:1644:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1644 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/auth/lib/index.d.ts:1650:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1650 export default defaultExport; ~~~~~~ packages/crashlytics/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/crashlytics/lib/index.d.ts:254:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 254 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/crashlytics/lib/index.d.ts:255:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 255 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/crashlytics/lib/index.d.ts:256:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 256 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/crashlytics/lib/index.d.ts:259:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 259 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/crashlytics/lib/index.d.ts:265:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 265 export default defaultExport; ~~~~~~ packages/crashlytics/lib/index.d.ts:286:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 286 namespace ReactNativeFirebase { ~~~~~~~~~ packages/database/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/database/lib/index.d.ts:267:37 - error TS2304: Cannot find name 'value'. 267 update(values: { [key: string]: value }, onComplete?: Function): Promise; ~~~~~ packages/database/lib/index.d.ts:918:37 - error TS2304: Cannot find name 'value'. 918 update(values: { [key: string]: value }, onComplete?: Function): Promise; ~~~~~ packages/database/lib/index.d.ts:1253:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1253 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/database/lib/index.d.ts:1254:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1254 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/database/lib/index.d.ts:1255:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1255 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/database/lib/index.d.ts:1258:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1258 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/database/lib/index.d.ts:1264:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1264 export default defaultExport; ~~~~~~ packages/database/lib/index.d.ts:1286:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 1286 namespace ReactNativeFirebase { ~~~~~~~~~ packages/dynamic-links/lib/index.d.ts:543:22 - error TS2315: Type 'Function' is not generic. 543 onLink(listener: Function): Function; ~~~~~~~~~~~~~~~~~~~~~ packages/dynamic-links/lib/index.d.ts:571:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 571 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/dynamic-links/lib/index.d.ts:572:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 572 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/dynamic-links/lib/index.d.ts:573:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 573 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/dynamic-links/lib/index.d.ts:576:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 576 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/dynamic-links/lib/index.d.ts:582:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 582 export default defaultExport; ~~~~~~ packages/firestore/lib/index.d.ts:1965:66 - error TS2314: Generic type 'Promise' requires 1 type argument(s). 1965 runTransaction(updateFunction: (transaction: Transaction) => Promise): Promise; ~~~~~~~ packages/firestore/lib/index.d.ts:2028:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 2028 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/firestore/lib/index.d.ts:2029:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 2029 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/firestore/lib/index.d.ts:2030:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 2030 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/firestore/lib/index.d.ts:2033:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 2033 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/firestore/lib/index.d.ts:2039:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 2039 export default defaultExport; ~~~~~~ packages/functions/lib/index.d.ts:364:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 364 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/functions/lib/index.d.ts:365:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 365 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/functions/lib/index.d.ts:366:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 366 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/functions/lib/index.d.ts:369:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 369 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/functions/lib/index.d.ts:375:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 375 export default defaultExport; ~~~~~~ packages/iid/lib/index.d.ts:136:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 136 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/iid/lib/index.d.ts:137:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 137 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/iid/lib/index.d.ts:138:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 138 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/iid/lib/index.d.ts:141:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 141 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/iid/lib/index.d.ts:147:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 147 export default defaultExport; ~~~~~~ packages/in-app-messaging/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/in-app-messaging/lib/index.d.ts:152:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 152 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/in-app-messaging/lib/index.d.ts:153:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 153 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/in-app-messaging/lib/index.d.ts:154:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 154 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/in-app-messaging/lib/index.d.ts:157:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 157 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/in-app-messaging/lib/index.d.ts:163:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 163 export default module; ~~~~~~ packages/in-app-messaging/lib/index.d.ts:185:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 185 namespace ReactNativeFirebase { ~~~~~~~~~ packages/messaging/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/messaging/lib/index.d.ts:611:41 - error TS1015: Parameter cannot have question mark and initializer. 611 getToken(authorizedEntity?: string, scope?: string = 'FCM'): Promise; ~~~~~ packages/messaging/lib/index.d.ts:611:41 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation. 611 getToken(authorizedEntity?: string, scope?: string = 'FCM'): Promise; ~~~~~~~~~~~~~~~~~~~~~~ packages/messaging/lib/index.d.ts:626:44 - error TS1015: Parameter cannot have question mark and initializer. 626 deleteToken(authorizedEntity?: string, scope?: string = 'FCM'): Promise; ~~~~~ packages/messaging/lib/index.d.ts:626:44 - error TS2371: A parameter initializer is only allowed in a function or constructor implementation. 626 deleteToken(authorizedEntity?: string, scope?: string = 'FCM'): Promise; ~~~~~~~~~~~~~~~~~~~~~~ packages/messaging/lib/index.d.ts:900:5 - error TS7010: 'setBackgroundMessageHandler', which lacks return-type annotation, implicitly has an 'any' return type. 900 setBackgroundMessageHandler(handler: (message: RemoteMessage) => Promise); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/messaging/lib/index.d.ts:954:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 954 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/messaging/lib/index.d.ts:955:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 955 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/messaging/lib/index.d.ts:956:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 956 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/messaging/lib/index.d.ts:959:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 959 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/messaging/lib/index.d.ts:965:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 965 export default defaultExport; ~~~~~~ packages/messaging/lib/index.d.ts:987:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 987 namespace ReactNativeFirebase { ~~~~~~~~~ packages/ml-natural-language/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/ml-natural-language/lib/index.d.ts:229:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 229 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/ml-natural-language/lib/index.d.ts:230:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 230 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/ml-natural-language/lib/index.d.ts:231:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 231 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/ml-natural-language/lib/index.d.ts:234:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 234 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/ml-natural-language/lib/index.d.ts:240:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 240 export default defaultExport; ~~~~~~ packages/ml-natural-language/lib/index.d.ts:263:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 263 namespace ReactNativeFirebase { ~~~~~~~~~ packages/ml-vision/lib/BarcodeDetectorTypes.d.ts:52:18 - error TS2304: Cannot find name 'VisionRectangle'. 52 boundingBox: VisionRectangle; ~~~~~~~~~~~~~~~ packages/ml-vision/lib/BarcodeDetectorTypes.d.ts:57:19 - error TS2304: Cannot find name 'VisionPoint'. 57 cornerPoints: VisionPoint[]; ~~~~~~~~~~~ packages/ml-vision/lib/BarcodeDetectorTypes.d.ts:181:16 - error TS2304: Cannot find name 'VisionGeoPoint'. 181 geoPoint?: VisionGeoPoint; ~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:674:20 - error TS2430: Interface 'VisionDocumentText' incorrectly extends interface 'VisionText'. Types of property 'blocks' are incompatible. Type 'VisionDocumentTextBlock[]' is not assignable to type 'VisionTextBlock[]'. Type 'VisionDocumentTextBlock' is missing the following properties from type 'VisionTextBlock': lines, cornerPoints 674 export interface VisionDocumentText extends VisionText { ~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1173:32 - error TS2304: Cannot find name 'VisionBarcodeDetectorOptions'. 1173 barcodeDetectorOptions?: VisionBarcodeDetectorOptions, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1174:16 - error TS2304: Cannot find name 'VisionBarcode'. 1174 ): Promise; ~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1180:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1180 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/ml-vision/lib/index.d.ts:1181:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1181 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/ml-vision/lib/index.d.ts:1182:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1182 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/ml-vision/lib/index.d.ts:1185:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1185 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1187:69 - error TS2339: Property 'VisionBarcodeFormat' does not exist on type 'typeof FirebaseVisionTypes'. 1187 export const VisionBarcodeFormat: {} & typeof FirebaseVisionTypes.VisionBarcodeFormat; ~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1190:72 - error TS2339: Property 'VisionBarcodeValueType' does not exist on type 'typeof FirebaseVisionTypes'. 1190 export const VisionBarcodeValueType: {} & typeof FirebaseVisionTypes.VisionBarcodeValueType; ~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1191:72 - error TS2339: Property 'VisionBarcodeEmailType' does not exist on type 'typeof FirebaseVisionTypes'. 1191 export const VisionBarcodeEmailType: {} & typeof FirebaseVisionTypes.VisionBarcodeEmailType; ~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1192:72 - error TS2339: Property 'VisionBarcodePhoneType' does not exist on type 'typeof FirebaseVisionTypes'. 1192 export const VisionBarcodePhoneType: {} & typeof FirebaseVisionTypes.VisionBarcodePhoneType; ~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1193:74 - error TS2339: Property 'VisionBarcodeAddressType' does not exist on type 'typeof FirebaseVisionTypes'. 1193 export const VisionBarcodeAddressType: {} & typeof FirebaseVisionTypes.VisionBarcodeAddressType; ~~~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1196:74 - error TS2694: Namespace '"/Users/Matt/Development/react-native-firebase/packages/ml-vision/lib/index".FirebaseVisionTypes' has no exported member 'VisionBarcodeWifiEncryptionType'. 1196 export const VisionBarcodeWifiEncryptionType: {} & FirebaseVisionTypes.VisionBarcodeWifiEncryptionType; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ packages/ml-vision/lib/index.d.ts:1207:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1207 export default defaultExport; ~~~~~~ packages/ml-vision/lib/index.d.ts:1229:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 1229 namespace ReactNativeFirebase { ~~~~~~~~~ packages/perf/lib/index.d.ts:18:10 - error TS2440: Import declaration conflicts with local declaration of 'ReactNativeFirebase'. 18 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:112:5 - error TS7010: 'putAttribute', which lacks return-type annotation, implicitly has an 'any' return type. 112 putAttribute(attribute: string, value: string); ~~~~~~~~~~~~ packages/perf/lib/index.d.ts:158:5 - error TS7010: 'putMetric', which lacks return-type annotation, implicitly has an 'any' return type. 158 putMetric(metricName: string, value: number); ~~~~~~~~~ packages/perf/lib/index.d.ts:172:5 - error TS7010: 'incrementMetric', which lacks return-type annotation, implicitly has an 'any' return type. 172 incrementMetric(metricName: string, incrementBy: number); ~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:185:5 - error TS7010: 'removeMetric', which lacks return-type annotation, implicitly has an 'any' return type. 185 removeMetric(metricName: string); ~~~~~~~~~~~~ packages/perf/lib/index.d.ts:259:5 - error TS7010: 'putAttribute', which lacks return-type annotation, implicitly has an 'any' return type. 259 putAttribute(attribute: string, value: string); ~~~~~~~~~~~~ packages/perf/lib/index.d.ts:272:5 - error TS7010: 'removeAttribute', which lacks return-type annotation, implicitly has an 'any' return type. 272 removeAttribute(attribute: string); ~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:288:5 - error TS7010: 'setHttpResponseCode', which lacks return-type annotation, implicitly has an 'any' return type. 288 setHttpResponseCode(code: number | null); ~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:302:5 - error TS7010: 'setRequestPayloadSize', which lacks return-type annotation, implicitly has an 'any' return type. 302 setRequestPayloadSize(bytes: number | null); ~~~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:316:5 - error TS7010: 'setResponsePayloadSize', which lacks return-type annotation, implicitly has an 'any' return type. 316 setResponsePayloadSize(bytes: number | null); ~~~~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:330:5 - error TS7010: 'setResponseContentType', which lacks return-type annotation, implicitly has an 'any' return type. 330 setResponseContentType(contentType: string | null); ~~~~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:448:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 448 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/perf/lib/index.d.ts:449:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 449 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/perf/lib/index.d.ts:450:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 450 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/perf/lib/index.d.ts:453:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 453 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/perf/lib/index.d.ts:459:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 459 export default defaultExport; ~~~~~~ packages/perf/lib/index.d.ts:480:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier. 480 namespace ReactNativeFirebase { ~~~~~~~~~ packages/remote-config/lib/index.d.ts:522:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 522 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/remote-config/lib/index.d.ts:523:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 523 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/remote-config/lib/index.d.ts:524:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 524 import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics; ~~~~~~ packages/remote-config/lib/index.d.ts:527:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 527 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/remote-config/lib/index.d.ts:533:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 533 export default defaultExport; ~~~~~~ packages/storage/lib/index.d.ts:1102:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1102 import { ReactNativeFirebase } from '@react-native-firebase/app'; ~~~~~~ packages/storage/lib/index.d.ts:1103:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1103 import ReactNativeFirebaseModule = ReactNativeFirebase.Module; ~~~~~~ packages/storage/lib/index.d.ts:1104:3 - error TS2667: Imports are not permitted in module augmentations. Consider moving them to the enclosing external module. 1104 import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; ~~~~~~ packages/storage/lib/index.d.ts:1107:27 - error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference. 1107 export const firebase = firebaseNamedExport; ~~~~~~~~~~~~~~~~~~~ packages/storage/lib/index.d.ts:1113:3 - error TS2666: Exports and export assignments are not permitted in module augmentations. 1113 export default defaultExport; ~~~~~~ ```

mikehardy commented 3 years ago

So it seems any PR to fix this should include that change to the tsconfig.json - do you have anything in mind for a PR?

mattlubner commented 3 years ago

I don't think I'll be able to fix this, at least not yet, as I'm still new to TypeScript, & these type declaration files are some of the most complex I've seen so far. Definitely don't want to make it worse!

davidgovea commented 3 years ago

Pinging this thread since there are many subscribers:

If you want to try skipLibCheck: false-compatible types, check out these patch-package files. Install a patchfile for each RNFB library you use: https://gist.github.com/davidgovea/2feea6af41b41f76fae1a9c14465cb69

It's working for me! But I only use app & analytics in production. Would appreciate any feedback. Tracking the work in PR #4306

mikehardy commented 3 years ago

@davidgovea did you know I added auto-patch-package generation here :-) - check it out: https://github.com/invertase/react-native-firebase/actions/runs/271992461 (it's off the "Checks" area on the PR then the "Create Test Patches" action

Thank you for the PR in general though! I would love to hear positive feedback and I'm excited to merge them. I use most of the modules myself and I'll give them a try in my work project to see how it goes also

ed3899 commented 2 years ago

Getting this while running npm run build

`
../node_modules/@types/react-native/globals.d.ts:168:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Response' must be of type '{ new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error(): Response; redirect(url: string | URL, status?: number | undefined): Response; }', but here has type '{ new (body?: BodyInit_ | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error: () => Response; redirect: (url: string, status?: number | undefined) => Response; }'.     

168 declare var Response: {
                ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:11275:13
    11275 declare var Response: {
                      ~~~~~~~~
    'Response' was also declared here.

../node_modules/@types/react-native/globals.d.ts:245:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'abort' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

245     abort: ProgressEvent;
        ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16664:5
    16664     "abort": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'abort' was also declared here.

../node_modules/@types/react-native/globals.d.ts:246:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

246     error: ProgressEvent;
        ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16665:5
    16665     "error": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'error' was also declared here.

../node_modules/@types/react-native/globals.d.ts:247:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'load' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

247     load: ProgressEvent;
        ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16666:5
    16666     "load": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~
    'load' was also declared here.

../node_modules/@types/react-native/globals.d.ts:248:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadend' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

248     loadend: ProgressEvent;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16667:5
    16667     "loadend": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'loadend' was also declared here.

../node_modules/@types/react-native/globals.d.ts:249:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadstart' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

249     loadstart: ProgressEvent;
        ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16668:5
    16668     "loadstart": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~~
    'loadstart' was also declared here.

../node_modules/@types/react-native/globals.d.ts:250:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'progress' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

250     progress: ProgressEvent;
        ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16669:5
    16669     "progress": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~
    'progress' was also declared here.

../node_modules/@types/react-native/globals.d.ts:251:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'timeout' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

251     timeout: ProgressEvent;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16670:5
    16670     "timeout": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'timeout' was also declared here.

../node_modules/@types/react-native/globals.d.ts:292:14 - error TS2300: Duplicate identifier 'XMLHttpRequestResponseType'.

292 declare type XMLHttpRequestResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17949:6
    17949 type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
               ~~~~~~~~~~~~~~~~~~~~~~~~~~
    'XMLHttpRequestResponseType' was also declared here.

../node_modules/@types/react-native/globals.d.ts:299:15 - error TS2300: Duplicate identifier 'URL'.

299 declare class URL {
                  ~~~

  node_modules/typescript/lib/lib.dom.d.ts:13988:11
    13988 interface URL {
                    ~~~
    'URL' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14005:13
    14005 declare var URL: {
                      ~~~
    and here.

../node_modules/@types/react-native/globals.d.ts:324:15 - error TS2300: Duplicate identifier 'URLSearchParams'.

324 declare class URLSearchParams {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:14015:11
    14015 interface URLSearchParams {
                    ~~~~~~~~~~~~~~~
    'URLSearchParams' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14034:13
    14034 declare var URLSearchParams: {
                      ~~~~~~~~~~~~~~~
    and here.
  node_modules/typescript/lib/lib.dom.iterable.d.ts:256:11
    256 interface URLSearchParams {
                  ~~~~~~~~~~~~~~~
    and here.

../node_modules/@types/react-native/globals.d.ts:368:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onopen' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '(() => void) | null'.

368     onopen: (() => void) | null;
        ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16201:5
    16201     onopen: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~
    'onopen' was also declared here.

../node_modules/@types/react-native/globals.d.ts:369:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onmessage' must be of type '((this: WebSocket, ev: MessageEvent<any>) => any) | null', but here has type '((event: WebSocketMessageEvent) => void) | null'.

369     onmessage: ((event: WebSocketMessageEvent) => void) | null;
        ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16200:5
    16200     onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
              ~~~~~~~~~
    'onmessage' was also declared here.

../node_modules/@types/react-native/globals.d.ts:370:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onerror' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '((event: WebSocketErrorEvent) => void) | null'.

370     onerror: ((event: WebSocketErrorEvent) => void) | null;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16199:5
    16199     onerror: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~~
    'onerror' was also declared here.

../node_modules/@types/react-native/globals.d.ts:371:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onclose' must be of type '((this: WebSocket, ev: CloseEvent) => any) | null', but here has type '((event: WebSocketCloseEvent) => void) | null'.

371     onclose: ((event: WebSocketCloseEvent) => void) | null;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16198:5
    16198     onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
              ~~~~~~~
    'onclose' was also declared here.

../node_modules/@types/react-native/globals.d.ts:372:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'addEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

372     addEventListener: WebsocketEventListener;
        ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16216:5
    16216     addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'addEventListener' was also declared here.

../node_modules/@types/react-native/globals.d.ts:373:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'removeEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

373     removeEventListener: WebsocketEventListener;
        ~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16218:5
    16218     removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'removeEventListener' was also declared here.

../node_modules/@types/react-native/globals.d.ts:376:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'WebSocket' must be of type '{ new (url: string | URL, protocols?: string | string[] | undefined): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; }', but here has type '{ new (uri: string, protocols?: string | string[] | null | undefined, options?: { [optionName: string]: any; headers: { [headerName: string]: string; }; } | null | undefined): WebSocket; ... 4 more ...; readonly OPEN: number; }'.

376 declare var WebSocket: {
                ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16222:13
    16222 declare var WebSocket: {
                      ~~~~~~~~~
    'WebSocket' was also declared here.

../node_modules/@types/react-native/globals.d.ts:400:15 - error TS2300: Duplicate identifier 'AbortSignal'.

400 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1913:11
    1913 interface AbortSignal extends EventTarget {
                   ~~~~~~~~~~~
    'AbortSignal' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:1923:13
    1923 declare var AbortSignal: {
                     ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:60:11
    60 interface AbortSignal {
                 ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:72:13
    72 declare var AbortSignal: {
                   ~~~~~~~~~~~
    and here.

../node_modules/@types/react-native/globals.d.ts:400:15 - error TS2420: Class 'AbortSignal' incorrectly implements interface 'EventTarget'.
  Property 'dispatchEvent' is missing in type 'AbortSignal' but required in type 'EventTarget'.

400 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5033:5
    5033     dispatchEvent(event: Event): boolean;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'dispatchEvent' is declared here.

../node_modules/@types/react-native/globals.d.ts:435:15 - error TS2300: Duplicate identifier 'AbortController'.      

435 declare class AbortController {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1896:11
    1896 interface AbortController {
                   ~~~~~~~~~~~~~~~
    'AbortController' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:1903:13
    1903 declare var AbortController: {
                     ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:47:11
    47 interface AbortController {
                 ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:67:13
    67 declare var AbortController: {
                   ~~~~~~~~~~~~~~~
    and here.

../node_modules/@types/react-native/globals.d.ts:460:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'DOMException | null', but here has type 'Error | null'.

460     readonly error: Error | null;
                 ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5092:14
    5092     readonly error: DOMException | null;
                      ~~~~~
    'error' was also declared here.

../node_modules/@types/react-native/globals.d.ts:468:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'result' must be of type 'string | ArrayBuffer | null', but here has type 'string | ArrayBuffer'.

468     readonly result: string | ArrayBuffer;
                 ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5100:14
    5100     readonly result: string | ArrayBuffer | null;
                      ~~~~~~
    'result' was also declared here.

../node_modules/@types/react-native/index.d.ts:9742:11 - error TS2451: Cannot redeclare block-scoped variable 'originalXMLHttpRequest'.

9742     const originalXMLHttpRequest: any;
               ~~~~~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9807:11
    9807     const originalXMLHttpRequest: any;
                   ~~~~~~~~~~~~~~~~~~~~~~
    'originalXMLHttpRequest' was also declared here.

../node_modules/@types/react-native/index.d.ts:9744:11 - error TS2451: Cannot redeclare block-scoped variable '__BUNDLE_START_TIME__'.

9744     const __BUNDLE_START_TIME__: number;
               ~~~~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9809:11
    9809     const __BUNDLE_START_TIME__: number;
                   ~~~~~~~~~~~~~~~~~~~~~
    '__BUNDLE_START_TIME__' was also declared here.

../node_modules/@types/react-native/index.d.ts:9745:11 - error TS2451: Cannot redeclare block-scoped variable 'ErrorUtils'.

9745     const ErrorUtils: ErrorUtils;
               ~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9810:11
    9810     const ErrorUtils: ErrorUtils;
                   ~~~~~~~~~~
    'ErrorUtils' was also declared here.

../node_modules/@types/react-native/index.d.ts:9752:11 - error TS2451: Cannot redeclare block-scoped variable '__DEV__'.

9752     const __DEV__: boolean;
               ~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9817:11
    9817     const __DEV__: boolean;
                   ~~~~~~~
    '__DEV__' was also declared here.

../node_modules/@types/react-native/index.d.ts:9754:11 - error TS2451: Cannot redeclare block-scoped variable 'HermesInternal'.

9754     const HermesInternal: null | {};
               ~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9819:11
    9819     const HermesInternal: null | {};
                   ~~~~~~~~~~~~~~
    'HermesInternal' was also declared here.

../node_modules/@types/react-native/LaunchScreen.d.ts:4:18 - error TS2451: Cannot redeclare block-scoped variable 'Header'.

4     export const Header: any;
                   ~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:4:18      
    4     export const Header: any;
                       ~~~~~~
    'Header' was also declared here.

../node_modules/@types/react-native/LaunchScreen.d.ts:5:18 - error TS2451: Cannot redeclare block-scoped variable 'LearnMoreLinks'.

5     export const LearnMoreLinks: any;
                   ~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:5:18      
    5     export const LearnMoreLinks: any;
                       ~~~~~~~~~~~~~~
    'LearnMoreLinks' was also declared here.

../node_modules/@types/react-native/LaunchScreen.d.ts:6:18 - error TS2451: Cannot redeclare block-scoped variable 'Colors'.

6     export const Colors: any;
                   ~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:6:18      
    6     export const Colors: any;
                       ~~~~~~
    'Colors' was also declared here.

../node_modules/@types/react-native/LaunchScreen.d.ts:7:18 - error TS2451: Cannot redeclare block-scoped variable 'DebugInstructions'.

7     export const DebugInstructions: any;
                   ~~~~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:7:18      
    7     export const DebugInstructions: any;
                       ~~~~~~~~~~~~~~~~~
    'DebugInstructions' was also declared here.

../node_modules/@types/react-native/LaunchScreen.d.ts:8:18 - error TS2451: Cannot redeclare block-scoped variable 'ReloadInstructions'.

8     export const ReloadInstructions: any;
                   ~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:8:18      
    8     export const ReloadInstructions: any;
                       ~~~~~~~~~~~~~~~~~~
    'ReloadInstructions' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/BatchedBridge.d.ts:8:15 - error TS2300: Duplicate identifier 'MessageQueue'.

8 declare class MessageQueue {
                ~~~~~~~~~~~~

  ../node_modules/@types/react-native/BatchedBridge.d.ts:8:15
    8 declare class MessageQueue {
                    ~~~~~~~~~~~~
    'MessageQueue' was also declared here.
  ../node_modules/@types/react-native/BatchedBridge.d.ts:22:20
    22     export default MessageQueue;
                          ~~~~~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/BatchedBridge.d.ts:18:20 - error TS2300: Duplicate identifier 'BatchedBridge'.

18     export default BatchedBridge;
                      ~~~~~~~~~~~~~

  ../node_modules/@types/react-native/BatchedBridge.d.ts:18:20
    18     export default BatchedBridge;
                          ~~~~~~~~~~~~~
    'BatchedBridge' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/BatchedBridge.d.ts:22:20 - error TS2300: Duplicate identifier 'MessageQueue'.

22     export default MessageQueue;
                      ~~~~~~~~~~~~

  ../node_modules/@types/react-native/BatchedBridge.d.ts:8:15
    8 declare class MessageQueue {
                    ~~~~~~~~~~~~
    'MessageQueue' was also declared here.
  ../node_modules/@types/react-native/BatchedBridge.d.ts:22:20
    22     export default MessageQueue;
                          ~~~~~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/Devtools.d.ts:2:17 - error TS2300: Duplicate identifier 'StackFrame'.

2     export type StackFrame = {
                  ~~~~~~~~~~

  ../node_modules/@types/react-native/Devtools.d.ts:2:17
    2     export type StackFrame = {
                      ~~~~~~~~~~
    'StackFrame' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:10:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: FormDataPart, BodyInit_, HeadersInit_, RequestCredentials_, RequestMode_, ResponseType_, WebsocketMessageEventListener, WebsocketErrorEventListener, WebsocketOpenEventListener, WebsocketCloseEventListener, WebsocketEventListener

10 declare function clearInterval(handle: number): void;
   ~~~~~~~

  ../node_modules/@types/react-native/globals.d.ts:10:1
    10 declare function clearInterval(handle: number): void;
       ~~~~~~~
    Conflicts are in this file.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:50:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Blob' must be of type '{ new (blobParts?: BlobPart[] | undefined, options?: BlobPropertyBag | undefined): Blob; prototype: Blob; }', but here has type '{ new (blobParts?: (string | Blob)[] | undefined, options?: BlobOptions | undefined): Blob; prototype: Blob; }'.

50 declare var Blob: {
               ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:2416:13
    2416 declare var Blob: {
                     ~~~~
    'Blob' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:65:15 - error TS2300: Duplicate identifier 'FormData'.

65 declare class FormData {
                 ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5286:11
    5286 interface FormData {
                   ~~~~~~~~
    'FormData' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:5296:13
    5296 declare var FormData: {
                     ~~~~~~~~
    and here.
  node_modules/typescript/lib/lib.dom.iterable.d.ts:79:11
    79 interface FormData {
                 ~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:100:5 - error TS2374: Duplicate index signature for type 'string'.

100     [key: string]: any;
        ~~~~~~~~~~~~~~~~~~~

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:122:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'body' must be of type 'BodyInit | null | undefined', but here has type 'BodyInit_ | undefined'.

122     body?: BodyInit_ | undefined;
        ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1498:5
    1498     body?: BodyInit | null;
             ~~~~
    'body' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:130:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'window' must be of type 'null | undefined', but here has type 'any'.

130     window?: any;
        ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1522:5
    1522     window?: null;
             ~~~~~~
    'window' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:131:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'signal' must be of type 'AbortSignal | null | undefined', but here has type 'AbortSignal | undefined'.

131     signal?: AbortSignal | undefined;
        ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1520:5
    1520     signal?: AbortSignal | null;
             ~~~~~~
    'signal' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:149:14 - error TS2300: Duplicate identifier 'RequestInfo'.

149 declare type RequestInfo = Request | string;
                 ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17794:6
    17794 type RequestInfo = Request | string;
               ~~~~~~~~~~~
    'RequestInfo' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:168:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'Response' must be of type '{ new (body?: BodyInit | null | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error(): Response; redirect(url: string | URL, status?: number | undefined): Response; }', but here has type '{ new (body?: BodyInit_ | undefined, init?: ResponseInit | undefined): Response; prototype: Response; error: () => Response; redirect: (url: string, status?: number | undefined) => Response; }'.

168 declare var Response: {
                ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:11275:13
    11275 declare var Response: {
                      ~~~~~~~~
    'Response' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:245:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'abort' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

245     abort: ProgressEvent;
        ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16664:5
    16664     "abort": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'abort' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:246:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

246     error: ProgressEvent;
        ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16665:5
    16665     "error": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~
    'error' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:247:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'load' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

247     load: ProgressEvent;
        ~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16666:5
    16666     "load": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~
    'load' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:248:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadend' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

248     loadend: ProgressEvent;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16667:5
    16667     "loadend": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'loadend' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:249:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'loadstart' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

249     loadstart: ProgressEvent;
        ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16668:5
    16668     "loadstart": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~~
    'loadstart' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:250:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'progress' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

250     progress: ProgressEvent;
        ~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16669:5
    16669     "progress": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~~
    'progress' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:251:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'timeout' must be of type 'ProgressEvent<XMLHttpRequestEventTarget>', but here has type 'ProgressEvent<EventTarget>'.

251     timeout: ProgressEvent;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16670:5
    16670     "timeout": ProgressEvent<XMLHttpRequestEventTarget>;
              ~~~~~~~~~
    'timeout' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:292:14 - error TS2300: Duplicate identifier 'XMLHttpRequestResponseType'.

292 declare type XMLHttpRequestResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:17949:6
    17949 type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
               ~~~~~~~~~~~~~~~~~~~~~~~~~~
    'XMLHttpRequestResponseType' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:299:15 - error TS2300: Duplicate identifier 'URL'.

299 declare class URL {
                  ~~~

  node_modules/typescript/lib/lib.dom.d.ts:13988:11
    13988 interface URL {
                    ~~~
    'URL' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14005:13
    14005 declare var URL: {
                      ~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:324:15 - error TS2300: Duplicate identifier 'URLSearchParams'.

324 declare class URLSearchParams {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:14015:11
    14015 interface URLSearchParams {
                    ~~~~~~~~~~~~~~~
    'URLSearchParams' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:14034:13
    14034 declare var URLSearchParams: {
                      ~~~~~~~~~~~~~~~
    and here.
  node_modules/typescript/lib/lib.dom.iterable.d.ts:256:11
    256 interface URLSearchParams {
                  ~~~~~~~~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:368:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onopen' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '(() => void) | null'.

368     onopen: (() => void) | null;
        ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16201:5
    16201     onopen: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~
    'onopen' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:369:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onmessage' must be of type '((this: WebSocket, ev: MessageEvent<any>) => any) | null', but here has type '((event: WebSocketMessageEvent) => void) | null'.     

369     onmessage: ((event: WebSocketMessageEvent) => void) | null;
        ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16200:5
    16200     onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
              ~~~~~~~~~
    'onmessage' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:370:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onerror' must be of type '((this: WebSocket, ev: Event) => any) | null', but here has type '((event: WebSocketErrorEvent) => void) | null'.

370     onerror: ((event: WebSocketErrorEvent) => void) | null;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16199:5
    16199     onerror: ((this: WebSocket, ev: Event) => any) | null;
              ~~~~~~~
    'onerror' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:371:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'onclose' must be of type '((this: WebSocket, ev: CloseEvent) => any) | null', but here has type '((event: WebSocketCloseEvent) => void) | null'.

371     onclose: ((event: WebSocketCloseEvent) => void) | null;
        ~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16198:5
    16198     onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;
              ~~~~~~~
    'onclose' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:372:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'addEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

372     addEventListener: WebsocketEventListener;
        ~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16216:5
    16216     addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'addEventListener' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:373:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'removeEventListener' must be of type '{ <K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | ... 1 more ... | undefined): void; }', but here has type 'WebsocketEventListener'.

373     removeEventListener: WebsocketEventListener;
        ~~~~~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16218:5
    16218     removeEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'removeEventListener' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:376:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'WebSocket' must be of type '{ new (url: string | URL, protocols?: string | string[] | undefined): WebSocket; prototype: WebSocket; readonly CLOSED: number; readonly CLOSING: number; readonly CONNECTING: number; readonly OPEN: number; }', but here has type '{ new (uri: string, protocols?: string | string[] | null | undefined, options?: { [optionName: string]: any; headers: { [headerName: string]: string; }; } | null | undefined): WebSocket; ... 4 more ...; readonly OPEN: number; }'.

376 declare var WebSocket: {
                ~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:16222:13
    16222 declare var WebSocket: {
                      ~~~~~~~~~
    'WebSocket' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:400:15 - error TS2300: Duplicate identifier 'AbortSignal'.

400 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1913:11
    1913 interface AbortSignal extends EventTarget {
                   ~~~~~~~~~~~
    'AbortSignal' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:1923:13
    1923 declare var AbortSignal: {
                     ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:60:11
    60 interface AbortSignal {
                 ~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:72:13
    72 declare var AbortSignal: {
                   ~~~~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:400:15 - error TS2420: Class 'AbortSignal' incorrectly implements interface 'EventTarget'.
  Property 'dispatchEvent' is missing in type 'AbortSignal' but required in type 'EventTarget'.

400 declare class AbortSignal implements EventTarget {
                  ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5033:5
    5033     dispatchEvent(event: Event): boolean;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'dispatchEvent' is declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:435:15 - error TS2300: Duplicate identifier 'AbortController'.

435 declare class AbortController {
                  ~~~~~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:1896:11
    1896 interface AbortController {
                   ~~~~~~~~~~~~~~~
    'AbortController' was also declared here.
  node_modules/typescript/lib/lib.dom.d.ts:1903:13
    1903 declare var AbortController: {
                     ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:47:11
    47 interface AbortController {
                 ~~~~~~~~~~~~~~~
    and here.
  node_modules/@types/node/globals.d.ts:67:13
    67 declare var AbortController: {
                   ~~~~~~~~~~~~~~~
    and here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:460:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'error' must be of type 'DOMException | null', but here has type 'Error | null'.

460     readonly error: Error | null;
                 ~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5092:14
    5092     readonly error: DOMException | null;
                      ~~~~~
    'error' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/globals.d.ts:468:14 - error TS2717: Subsequent property declarations must have the same type.  Property 'result' must be of type 'string | ArrayBuffer | null', but here has type 'string | ArrayBuffer'.

468     readonly result: string | ArrayBuffer;
                 ~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:5100:14
    5100     readonly result: string | ArrayBuffer | null;
                      ~~~~~~
    'result' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9807:11 - error TS2451: Cannot redeclare block-scoped variable 'originalXMLHttpRequest'.

9807     const originalXMLHttpRequest: any;
               ~~~~~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/index.d.ts:9742:11
    9742     const originalXMLHttpRequest: any;
                   ~~~~~~~~~~~~~~~~~~~~~~
    'originalXMLHttpRequest' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9809:11 - error TS2451: Cannot redeclare block-scoped variable '__BUNDLE_START_TIME__'.

9809     const __BUNDLE_START_TIME__: number;
               ~~~~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/index.d.ts:9744:11
    9744     const __BUNDLE_START_TIME__: number;
                   ~~~~~~~~~~~~~~~~~~~~~
    '__BUNDLE_START_TIME__' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9810:11 - error TS2451: Cannot redeclare block-scoped variable 'ErrorUtils'.

9810     const ErrorUtils: ErrorUtils;
               ~~~~~~~~~~

  ../node_modules/@types/react-native/index.d.ts:9745:11
    9745     const ErrorUtils: ErrorUtils;
                   ~~~~~~~~~~
    'ErrorUtils' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9817:11 - error TS2451: Cannot redeclare block-scoped variable '__DEV__'.

9817     const __DEV__: boolean;
               ~~~~~~~

  ../node_modules/@types/react-native/index.d.ts:9752:11
    9752     const __DEV__: boolean;
                   ~~~~~~~
    '__DEV__' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/index.d.ts:9819:11 - error TS2451: Cannot redeclare block-scoped variable 'HermesInternal'.

9819     const HermesInternal: null | {};
               ~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/index.d.ts:9754:11
    9754     const HermesInternal: null | {};
                   ~~~~~~~~~~~~~~
    'HermesInternal' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:4:18 - error TS2451: Cannot redeclare block-scoped variable 'Header'.

4     export const Header: any;
                   ~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:4:18
    4     export const Header: any;
                       ~~~~~~
    'Header' was also declared here.

../node_modules/@types/styled-components-react-native/node_modules/@types/react-native/LaunchScreen.d.ts:5:18 - error TS2451: Cannot redeclare block-scoped variable 'LearnMoreLinks'.

5     export const LearnMoreLinks: any;
                   ~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:5:18
    5     export const LearnMoreLinks: any;
                       ~~~~~~~~~~~~~~
    'LearnMoreLinks' was also declared here.

8     export const ReloadInstructions: any;                   ~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/react-native/LaunchScreen.d.ts:8:18
    8     export const ReloadInstructions: any;
                       ~~~~~~~~~~~~~~~~~~
    'ReloadInstructions' was also declared here.
`

on a react-native project that uses firebase functions

Commit

ed3899 commented 2 years ago

this happened to me after migrating from v5 - v6.

i just added this line to tsconfig.json to please my pipelines but i dont think that this is an actual fix "skipLibCheck": true

Worked like a charm. Thanks!