FirebaseExtended / angularfire

AngularJS bindings for Firebase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR Error: Uncaught (in promise): TypeError: Cannot convert undefined or null to object

hbjydev opened this issue · comments

Version info

Angular: "@angular/core": "~8.2.11"

Firebase: "firebase": "^7.2.2"

AngularFire: "@angular/fire": "^5.2.1"

Other (e.g. Node, browser, operating system) (if applicable):

  • Node V11 LTS
  • Edge Beta
  • macOS 10.14 Mojave

Test case

Not applicable, the error doesn't appear in a development environment.

Steps to reproduce

  1. Go to https://hayden.codes/blog or https://hayden.codes/work
  2. Look in the console

Expected behavior

When built using ng build --prod or ng serve --prod, it should work as intended.

Actual behavior

In production (not development), it gives the error as follows.

main-es2015.dde87c1a421523cda409.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
    at hasOwnProperty (<anonymous>)
    at E (main-es2015.dde87c1a421523cda409.js:1)
    at Function.e.databaseIdFromApp (main-es2015.dde87c1a421523cda409.js:1)
    at new e (main-es2015.dde87c1a421523cda409.js:1)
    at Object.firestore (main-es2015.dde87c1a421523cda409.js:1)
    at e._getService (main-es2015.dde87c1a421523cda409.js:1)
    at e.<computed> [as firestore] (main-es2015.dde87c1a421523cda409.js:1)
    at main-es2015.dde87c1a421523cda409.js:1
    at a.invoke (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at s.run (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at P (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at P (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at polyfills-es2015.0ef207fb7b4761464817.js:1
    at a.invokeTask (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at Object.onInvokeTask (main-es2015.dde87c1a421523cda409.js:1)
    at a.invokeTask (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at s.runTask (polyfills-es2015.0ef207fb7b4761464817.js:1)
    at _ (polyfills-es2015.0ef207fb7b4761464817.js:1)

It is also important to note that this error only appears in production, the application runs as intended otherwise.

Just noticed this is in the wrong place. Moving to angular/angularfire