4

When I want to setup angularfire2-offline I get this error:

[16:02:08]  typescript: node_modules/angularfire2-offline/database/database.d.ts, line: 2 
            Cannot find module 'angularfire2/interfaces'. 

       L1:  import { AngularFireDatabase } from 'angularfire2/database';
       L2:  import { FirebaseListFactoryOpts, FirebaseObjectFactoryOpts } from 'angularfire2/interfaces';
       L3:  import { AfoListObservable } from './list/afo-list-observable';

[16:02:08]  typescript: node_modules/angularfire2-offline/database/interfaces.d.ts, line: 1 
            Cannot find module 'angularfire2/interfaces'. 

       L1:  import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';

[16:02:08]  typescript: node_modules/angularfire2-offline/database/list/afo-list-observable.d.ts, line: 1 
            Cannot find module 'angularfire2/interfaces'. 

       L1:  import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';
       L2:  import { ReplaySubject } from 'rxjs/ReplaySubject';

[16:02:08]  typescript: node_modules/angularfire2-offline/database/list/emulate-query.d.ts, line: 1 
            Cannot find module 'angularfire2/interfaces'. 

       L1:  import { FirebaseListFactoryOpts } from 'angularfire2/interfaces';
       L2:  export declare class EmulateQuery {

@ngModule in app.module.ts:

@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp),
    AngularFireModule.initializeApp(firebaseConfig),
    AngularFireDatabaseModule,
    AngularFireOfflineModule
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

Versions:

  • Ionic 3.9.2
  • CLI 3.8
  • angularfire2 4.0.0
  • angularfire2-offline 4.2.4
  • firebase 4.3.0
  • typescript 2.6.0

I was following the two tutorials:

https://github.com/adriancarriger/angularfire2-offline and https://javebratt.com/offline-angularfire2/

The error suddenly occured.

3
  • Can you show the code of NgModule section? Commented Aug 23, 2017 at 14:27
  • @NgModule({ declarations: [ MyApp, HomePage ], imports: [ BrowserModule, IonicModule.forRoot(MyApp), AngularFireModule.initializeApp(firebaseConfig), AngularFireDatabaseModule, AngularFireOfflineModule ], bootstrap: [IonicApp], entryComponents: [ MyApp, HomePage ], providers: [ StatusBar, SplashScreen, {provide: ErrorHandler, useClass: IonicErrorHandler} ] }) export class AppModule {} Commented Aug 23, 2017 at 15:00
  • Please put that on your post.Then everyone can read it nicely.Here can't. Commented Aug 23, 2017 at 15:02

1 Answer 1

2

It seems to be a problem with the new angularfire2 version

angularfire2 : 4.0.0-rc.2

I did a downgrade to previous version and now everything works fine.

npm install [email protected]
Sign up to request clarification or add additional context in comments.

1 Comment

Removing AngularFireModule from providers in app.module.ts is fixed for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.