0

I have a project where I use nativescript with Angular and want to implement Firebase for the back-end. I followed the instructions in the doc of the package and the firebase.init() works without errors. But when I want to use the firestore like here:

const usernameCollection = firebase.firestore().collection("testUsernames");

I get the error:

This expression is not callable. Type 'typeof firestore' has no call signatures.

I import the module like this:

import { firebase } from "@nativescript/firebase";
double-beep
  • 5,031
  • 17
  • 33
  • 41
16hitjon
  • 3
  • 2

2 Answers2

1

Your current import brings in the static types and classes, but not the module itself.

To bring in the module, you need to add /app to the end of the path as (poorly) shown here.

Wherever you see "nativescript-plugin-firebase", replace it with "@nativescript/firebase".

import * as firebase from "@nativescript/firebase/app";
samthecodingman
  • 23,122
  • 4
  • 30
  • 54
0

Add the following line:

import * as firebase from "@nativescript/firebase/app";
double-beep
  • 5,031
  • 17
  • 33
  • 41
Sambad
  • 147
  • 1
  • 7