No exported member error with firebase when trying to compile angular 10 project

appdevnoobie

I installed an angular dashboard template which I tested with ng serve to confirm worked. I then run

npm install firebase @angular/fire --save

to install firebase. And after adding firebase project credentials and editing the app.module.ts

    import { HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';

    import { AuthInterceptor, AuthService, FakeBackendInterceptor } from '@services/*';

    import { AppRoutingModule } from './app-routing.module';
    import { AppComponent } from './app.component';
    import { ChartsModule } from './pages/charts';
    import { ComponentsModule } from './pages/components';
    import { DashboardModule } from './pages/dashboard';
    import { Dashboard2Module } from './pages/dashboard2';
    import { FormsModule } from './pages/forms';

    import { AngularFireModule } from "@angular/fire";
    import { AngularFireAuthModule } from "@angular/fire/auth";
    import { AngularFirestoreModule } from '@angular/fire/firestore';
    import { environment } from '../environments/environment';

    @NgModule({
      declarations: [AppComponent],
      imports: [
        BrowserModule,
        AppRoutingModule,
        ComponentsModule,
        DashboardModule,
        Dashboard2Module,
        FormsModule,
        ChartsModule,
        HttpClientModule,
        AngularFireModule.initializeApp(environment.firebase),
        AngularFireAuthModule,
        AngularFirestoreModule, 
      ],
      providers: [
        AuthService,
        {
          provide: HTTP_INTERCEPTORS,
          useClass: AuthInterceptor,
          multi: true,
        },
        {
          provide: HTTP_INTERCEPTORS,
          useClass: FakeBackendInterceptor,
          multi: true,
        },
      ],
      bootstrap: [AppComponent],
    })
    export class AppModule {}

I get the following errors when I try to compile.

    ERROR in node_modules/@angular/fire/firebase.app.module.d.ts:2:10 - error TS2614: Module '"../../firebase"' has no exported member 'analytics'. Did you mean to use 'import analytics from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
               ~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:21 - error TS2614: Module '"../../firebase"' has no exported member 'app'. Did you mean to use 'import app from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                          ~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:26 - error TS2614: Module '"../../firebase"' has no exported member 'auth'. Did you mean to use 'import auth from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                               ~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:32 - error TS2614: Module '"../../firebase"' has no exported member 'database'. Did you mean to use 'import database from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                     ~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:42 - error TS2614: Module '"../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                               ~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:53 - error TS2614: Module '"../../firebase"' has no exported member 'functions'. Did you mean to use 'import functions from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                                          ~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:64 - error TS2614: Module '"../../firebase"' has no exported member 'messaging'. Did you mean to use 'import messaging from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                                                     ~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:75 - error TS2614: Module '"../../firebase"' has no exported member 'performance'. Did you mean to use 'import performance from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                                                                ~~~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:88 - error TS2614: Module '"../../firebase"' has no exported member 'remoteConfig'. Did you mean to use 'import remoteConfig from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                                                                             ~~~~~~~~~~~~
    node_modules/@angular/fire/firebase.app.module.d.ts:2:102 - error TS2614: Module '"../../firebase"' has no exported member 'storage'. Did you mean to use 'import storage from "../../firebase"' instead?

    2 import { analytics, app, auth, database, firestore, functions, messaging, performance, remoteConfig, storage } from 'firebase/app';
                                                                                                           ~~~~~~~
    node_modules/@angular/fire/auth/auth.d.ts:4:10 - error TS2614: Module '"../../../firebase"' has no exported member 'User'. Did you mean to use 'import User from "../../../firebase"' instead?

    4 import { User, auth } from 'firebase/app';
               ~~~~
    node_modules/@angular/fire/auth/auth.d.ts:4:16 - error TS2614: Module '"../../../firebase"' has no exported member 'auth'. Did you mean to use 'import auth from "../../../firebase"' instead?

    4 import { User, auth } from 'firebase/app';
                     ~~~~
    node_modules/@angular/fire/auth/auth.d.ts:12:14 - error TS2411: Property 'authState' of type 'Observable<any>' is not assignable to string index type 'Promise<any> & ((...args: unknown[]) => Promise<any>) & ((...args: unknown[]) => any)'.

    12     readonly authState: Observable<User | null>;
                    ~~~~~~~~~
    node_modules/@angular/fire/auth/auth.d.ts:16:14 - error TS2411: Property 'idToken' of type 'Observable<string>' is not assignable to string index type 'Promise<any> & ((...args: unknown[]) => Promise<any>) & ((...args: unknown[]) => any)'.

    16     readonly idToken: Observable<string | null>;
                    ~~~~~~~
    node_modules/@angular/fire/auth/auth.d.ts:20:14 - error TS2411: Property 'user' of type 'Observable<any>' is not assignable to string index type 'Promise<any> & ((...args: unknown[]) => Promise<any>) & ((...args: unknown[]) => any)'.

    20     readonly user: Observable<User | null>;
                    ~~~~
    node_modules/@angular/fire/auth/auth.d.ts:26:14 - error TS2411: Property 'idTokenResult' of type 'Observable<any>' is not assignable to string index type 'Promise<any> & ((...args: unknown[]) => Promise<any>) & ((...args: unknown[]) => any)'.

    26     readonly idTokenResult: Observable<auth.IdTokenResult | null>;
                    ~~~~~~~~~~~~~
    node_modules/@angular/fire/firestore/interfaces.d.ts:2:10 - error TS2614: Module '"../../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../firebase"' instead?

    2 import { firestore } from 'firebase/app';
               ~~~~~~~~~
    node_modules/@angular/fire/firestore/collection/collection.d.ts:2:10 - error TS2614: Module '"../../../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../../firebase"' instead?

    2 import { firestore } from 'firebase/app';
               ~~~~~~~~~
    node_modules/@angular/fire/firestore/document/document.d.ts:5:10 - error TS2614: Module '"../../../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../../firebase"' instead?

    5m import { firestore } from 'firebase/app';
               ~~~~~~~~~
    node_modules/@angular/fire/firestore/collection-group/collection-group.d.ts:2:10 - error TS2614: Module '"../../../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../../firebase"' instead?
    2 import { firestore } from 'firebase/app';
               ~~~~~~~~~
    node_modules/@angular/fire/firestore/firestore.d.ts:8:10 - error TS2614: Module '"../../../firebase"' has no exported member 'firestore'. Did you mean to use 'import firestore from "../../../firebase"' instead?

    8 import { firestore } from 'firebase/app';

But I cant figure out the cause of the errors. I have tried looking at several online tutorials for integrating firebase with angular but I cant see anything wrong

UPDATE

Attempted following the tutorial in https://www.positronx.io/full-angular-7-firebase-authentication-system/ word for word but I am still getting the same type of error

Rolo

I had a similar problem with Angular using Ionic, but after saving all the files and compiling again, the problem was gone. Why? I don't know, but in other projects I had similar situations.

Try to change something irrelevant (like adding some spaces between the lines) of each file you have been editing and save them before compiling.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Angular - "has no exported member 'Observable'"

From Dev

Compile error with initializer_list when trying to use it to initialize member value of class

From Dev

Assertion Error in Android Studio when trying to compile the working project

From Dev

When trying to compile my own stand alone exe for Electrum, there is an error

From Dev

error when trying to compile wrapper for openssl library libcrypto.a

From Dev

Swift error when trying to access Dictionary: `Could not find member 'subscript'`

From Dev

Error When Trying to Compile in Eclipse (MacOSX)

From Dev

Compilation error when trying to access the structure member with operator(->)

From Dev

Error when trying to compile MixKit library (C++)

From Dev

Compile error when trying to print an integer in Rust v0.13.0

From Dev

Compile error when defining a member function, but only in GCC

From Dev

Compile-time error when trying to parse a Boost Spirit grammar

From Dev

Angular 2 Module has no exported member

From Dev

Compile error when using a member of a user-defined literal

From Dev

@angular/core/testing has no exported member 'MockApplicationRef'

From Dev

Error: @angular/core/testing"' has no exported member 'beforeEach' after upgrading to angular rc.5

From Dev

Angular2 "no exported member bootstrap" error

From Dev

Compile error when trying to install qjournalctl

From Dev

Compile error when trying to run make

From Dev

Compilation error when trying to access the structure member with operator(->)

From Dev

80246008 error when trying to download windows 10

From Dev

@angular/core/testing has no exported member 'MockApplicationRef'

From Dev

Got compile error when trying to invoke function pointer to member functions

From Dev

Has no exported member Angular

From Dev

Maven crashes when trying to compile a project "Error executing Maven."

From Dev

I am getting and error as - Module ''selenium-webdriver'' has no exported member 'Promise', while trying to run protractor tests in webstorm

From Dev

@angular/material no exported member 'OverlayContainer'

From Dev

anychart 8.2.0 causes "Namespace has no exported member 'DataGridButton'" error in Angular4 npm start build

From Dev

Errors when trying to start Angular Project

Related Related

  1. 1

    Angular - "has no exported member 'Observable'"

  2. 2

    Compile error with initializer_list when trying to use it to initialize member value of class

  3. 3

    Assertion Error in Android Studio when trying to compile the working project

  4. 4

    When trying to compile my own stand alone exe for Electrum, there is an error

  5. 5

    error when trying to compile wrapper for openssl library libcrypto.a

  6. 6

    Swift error when trying to access Dictionary: `Could not find member 'subscript'`

  7. 7

    Error When Trying to Compile in Eclipse (MacOSX)

  8. 8

    Compilation error when trying to access the structure member with operator(->)

  9. 9

    Error when trying to compile MixKit library (C++)

  10. 10

    Compile error when trying to print an integer in Rust v0.13.0

  11. 11

    Compile error when defining a member function, but only in GCC

  12. 12

    Compile-time error when trying to parse a Boost Spirit grammar

  13. 13

    Angular 2 Module has no exported member

  14. 14

    Compile error when using a member of a user-defined literal

  15. 15

    @angular/core/testing has no exported member 'MockApplicationRef'

  16. 16

    Error: @angular/core/testing"' has no exported member 'beforeEach' after upgrading to angular rc.5

  17. 17

    Angular2 "no exported member bootstrap" error

  18. 18

    Compile error when trying to install qjournalctl

  19. 19

    Compile error when trying to run make

  20. 20

    Compilation error when trying to access the structure member with operator(->)

  21. 21

    80246008 error when trying to download windows 10

  22. 22

    @angular/core/testing has no exported member 'MockApplicationRef'

  23. 23

    Got compile error when trying to invoke function pointer to member functions

  24. 24

    Has no exported member Angular

  25. 25

    Maven crashes when trying to compile a project "Error executing Maven."

  26. 26

    I am getting and error as - Module ''selenium-webdriver'' has no exported member 'Promise', while trying to run protractor tests in webstorm

  27. 27

    @angular/material no exported member 'OverlayContainer'

  28. 28

    anychart 8.2.0 causes "Namespace has no exported member 'DataGridButton'" error in Angular4 npm start build

  29. 29

    Errors when trying to start Angular Project

HotTag

Archive