Using AngularFireFunctions breaks on ng serve
I created a brand new app from scratch and I followed the AngularFire Quickstart guide - All the latest versions of libraries are used. All works fine, until I add the AngularFireFunctions module to the project. As soon as I 'ng serve', the following error is given:
ERRROR####
ERROR in node_modules/@angular/fire/functions/functions.d.ts:10:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
This likely means that the library (@angular/fire/functions) which declares AngularFireFunctions has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
Version info
Angular: 9.1.1
Firebase: 7.14.3
AngularFire: 6.0.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): Node v12.16.3 OS: Windows 10 Pro
How to reproduce these conditions
Create an empty project following the quick start guide (https://github.com/angular/angularfire/blob/master/docs/install-and-setup.md). Add AngularFireFunctions module to the AppModule, and run ng serve
Steps to set up and reproduce https://github.com/raymondmcevilly-za/firebasefunctions (remember to add firebase config to environment ts file)
** Errors in the JavaScript console ** ERROR in node_modules/@angular/fire/functions/functions.d.ts:10:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
This likely means that the library (@angular/fire/functions) which declares AngularFireFunctions has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.
10 export declare class AngularFireFunctions {
~~~~~~~~~~~~~~~~~~~~
Expected behavior
To compile and run successfully
Actual behavior
Fails on ng serve
In my case I had to change this:
import { AngularFireFunctions } from '@angular/fire/functions/functions';
to:
import { AngularFireFunctions } from '@angular/fire/functions';
In my case I had to change this:
import { AngularFireFunctions } from '@angular/fire/functions/functions';
to:
import { AngularFireFunctions } from '@angular/fire/functions';
Just checked, and I am importing from '@angular/fire/functions' :(
Did you include the AngularFireFunctionsModule in your app.module.ts?
Oops, I knew I was going to open this ticket, only to realize I did something stupid. imported AngularFireFunctions instead of AngularFireFunctionsModule. Thanks Vandres