EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

Property 'functions' does not exist on type 'typeof firebase' #1803

Open abhayastudios opened 3 years ago

abhayastudios commented 3 years ago

Using NS8 with Angular and importing as import { firebase } from "@nativescript/firebase" I get the following error when accessing firebase.functions.httpsCallable():

ERROR in src/app/core/providers/firebase.provider.ts:113:27 - error TS2339: Property 'functions' does not exist on type 'typeof firebase'.

If I inspect the firebase object the functions property in fact does exist. Am I doing something wrong with the import or is this a bug?

abhayastudios commented 3 years ago

Borrowing from #1673 adding the import below and then directly accessing functions works, but seems like it would be preferable to fix the types so the second import is not needed.

import { firebase } from "@nativescript/firebase";
import { firebaseFunctions as functions } from "@nativescript/firebase/functions"
minimalDev01 commented 3 years ago

I solved this issue just importing firebase like this:

import * as firebase from "@nativescript/firebase";