0
votes

I'm trying once again to use Angular and Firebase on my projects.

I want to make a 2 pages website, where basically the home page is static and the second page is a blog using firestore, exactly as described on the official documentation.

"angularfire2": "^5.0.0-rc.10", "firebase": "^5.0.4",

I have no error when I compile, but as soon as I add this line : constructor(db: AngularFirestore) {}

the page doens't display and I get this weird error :

ERROR TypeError: webpack_require.i(...) is not a function at firestore.js:28

I have uninstalled / installed dozens of different versions of angularfire2, including AngularFire2@4..., but nothing works.

Any help would be appreciated . Thanks.

1
Impossible to help you unless you provide a demo. Can you use stackblitz.com to create a demo and I'll be happy to look at it. - nclarx

1 Answers

0
votes

Check if all imports are right and initialized and if possible, post your package.json "dependencies":

app.module.ts

...
imports:[
...
    AngularFireModule.initializeApp(environment.firebase),
    AngularFirestoreModule,
...
];

environment.ts

export const environment = {
  production: false,

  firebase: {
    apiKey: '',
    authDomain: '',
    ...
  }
};