nativescript-plugin-firebase icon indicating copy to clipboard operation
nativescript-plugin-firebase copied to clipboard

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

Open abhayastudios opened this issue 5 years ago • 2 comments

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 avatar Apr 03 '21 13:04 abhayastudios

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"

abhayastudios avatar Apr 03 '21 14:04 abhayastudios

I solved this issue just importing firebase like this:

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

minimalDev01 avatar Apr 20 '21 14:04 minimalDev01