The module "@react-native-firebase/firestore" does not have the specified exported member named 'CollectionReference'. (Error code: ts2614)

Utilizing TypeScript and React Native with Firestore (without expo).

When attempting to import:

import { CollectionReference } from '@react-native-firebase/firestore'

An error is received:

The module "@react-native-firebase/firestore" does not have an exported member 'CollectionReference'. Did you intend to use 'import CollectionReference from "@react-native-firebase/firestore"' instead? ts(2614)

The module was installed using both yarn and npm install.

Below are relevant parts of the packages.json:

{
  "dependencies": {
    "@react-native-firebase/app": "^8.4.3",
    "@react-native-firebase/auth": "^9.2.3",
    "@react-native-firebase/dynamic-links": "^7.5.4",
    "@react-native-firebase/firestore": "^7.8.2",
    "@react-native-firebase/storage": "^7.4.3",
    ...

  },
  "devDependencies": {
    "ts-node": "^8.10.2",
    "typescript": "^3.9.7"
    ...
  },

}

Although @firebase/firestore-types can still be used, it is specified as:

This package should not be directly used, and is meant to be used through the officially supported firebase package.

This is the web package and not intended for React Native Firebase.

Answer №1

Alright... This snippet is deep within the FirebaseFirestoreTypes.

I streamlined it by re-exporting:

import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore'

export type CollectionReference = FirebaseFirestoreTypes.CollectionReference
export type DocumentReference = FirebaseFirestoreTypes.DocumentReference
export type Timestamp = FirebaseFirestoreTypes.Timestamp

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

React.js not displaying icon

I'm encountering an issue where icons are not displaying in React Native JS. I've carefully reviewed all the codes, but I can't seem to find any errors. Strangely, when I run the app on Android, the icons are still not showing up. import {St ...

Transmit information to a modal by utilizing the ngx-bootstrap modal component

I have been encountering issues while trying to use angular 8 and ngx-bootstrap to open modals and pass data from parent to modal. It is not working as expected. Can anyone provide guidance on what steps I should take to resolve this issue? Here is the lin ...

Exploring the proper way to infer generic types for Redux Toolkit Slices

I've been working on a function that takes a slice factory as an argument and performs some operations on it. However, I'm facing challenges in setting up the types correctly. Below is a simple example showcasing the issue: Slice factory: expor ...

Currently, there is a requirement to include past build outcomes in the HTML test report within the playwright

Is there a way to display the previous build status of each test case for every test case? I have been attempting to use test.info() in playwright, but it seems inaccessible from onTestEnd. One option could be to retrieve the previous build data from Jenki ...

How can I call a global function in Angular 8?

Currently implementing Angular 8, my objective is to utilize downloaded SVG icons through a .js library. To achieve this, I have made the necessary additions to my .angular.json file: "scripts": [ "node_modules/csspatternlibrary3/js/site ...

Encountering Typescript issues while trying to access @angular/core packages

Recently, I made an update to my Ionic app from Angular 7 to Angular 8, and an odd error popped up: https://i.sstatic.net/icZOb.png The issue lies in the fact that I am unable to access any of the standard classes stored in the @angular/core module. This ...

Ensuring that a TypeORM column has been updated

Currently, I am utilizing TypeORM with the ActiveRecord design pattern and have created this entity: @Entity() export class User { @PrimaryGeneratedColumn() public id: number; @Column() public username: string; @Column() public password: stri ...

Obtaining undefined values for req and resolvedUrl in GetServerSideProps function

In my project, I am currently using next.js version ""next": "^12.1.4"" and node version ""@types/node": "^14.14.6". I have created a function called getServerSideProps with parameters req and resolvedUrl. When the ...

Enabling Event bus suggestions for Typescript: A step-by-step guide

Hello, I've encountered an issue while attempting to add types for the TinyEmitter library. Specifically, I need to define two methods. First: addEventListener(e: string, (...args: any[]) => void): void; Second: emit(e: string, ...args: any[]): vo ...

Is Angular Template Polymorphism Failing?

So I'm working with a base class that has another class extending it. export class Person { public name: string; public age: number; } export class Teacher extends Person { public yearsTeaching: number; } Now, in my component, I need to ...

Angular 2: The *ngFor directive is unable to locate a suitable differing framework

Below is the code for client.service.ts clients: Client[]; getClientList() { let headers = new Headers(); headers.append('Content-Type', 'application/json'); let authToken = localStorage.getItem('auth_token&apo ...

What is the best way to exempt a unique situation from a directive's operation?

While troubleshooting a bug related to search functionality on my page, I encountered an issue with the search component. The search feature is working correctly and returning the expected values. However, when I clear the search criteria, I noticed that t ...

Utilizing Google OAuth2 API within an Angular2 Typescript Application

Looking to incorporate the Google oauth2 API and Calender API into my Angular2 application. Struggling to find a working sample to guide me through the integration process. Has anyone come across a functioning example? Thanks, Hacki ...

Validating Date and Time in Angular 6 using ngIf within an HTML template

I am currently utilizing Angular6. Displayed below is the ngfor with a div. The API provides the meeting date and time along with the status, which is usually listed as upcoming. For example, if the date is 09/18/2018 and the time is 5.30 PM. <div cl ...

Is it possible for TypeScript to automatically determine the type of an imported module based on its path?

I'm currently working on creating a function, test.isolated(), which wraps around jest.isolateModules. This function takes an array of strings representing the modules to be imported, along with the usual arguments (name, fn, timeout), and then inject ...

Can a variable in Typescript be defined to accept any value as long as it follows a specific format?

For instance, I am searching for a way to represent any value that consists of two strings separated by an underscore "_". I attempted something along the lines of: let key:string = string1 + "_" + string2; Upon entering this code, I quickly realized ...

TSLint Errors Update: The configuration provided cannot locate implementations for the following rules

After upgrading my tslint to version 4.0.2, I encountered numerous errors like the ones shown below: Could not find implementations for the following rules specified in the configuration: directive-selector-name component-selector-name directi ...

Angular - The argument provided is not compatible with the parameter

I encountered the following TypeScript errors in app.component.ts: Issue: Argument of type '(events: Event[]) => void' is not assignable to parameter of type '(value: Event[]) => void'. Description: Types of parameters 'e ...

Dynamically setting properties in a Vue component using Angular

After browsing through this interesting discussion, I decided to create a web component: <my-vue-web-comp [userId]="1"></my-vue-web-comp> Initially, everything was working smoothly in Angular when I assigned a static property. Howeve ...

Transforming Bootstrap using Typescript styled components

I have been working on customizing the Navbar in my React app using Typescript's styled components. However, I am facing difficulties in restyling the default styles from Bootstrap that I have copied. Here is an example of the React Bootstrap Navbar c ...