相关疑难解决方法(0)

TypeError:Object(...)不是函数

使用ionic3,angularfire2 v5

TypeError:Object(...)不是SwitchMapSubscriber._next上的SwitchMapSubscriber.project(http:// localhost:8100/build/vendor.js:73935:76)的函数(http:// localhost:8100/build/vendor.js:61778:27)在SwitchMapSubscriber.Subscriber.next(http:// localhost:8100/build/vendor.js:20750:18)的RefCountSubscriber.Subscriber._next(http:// localhost:8100/build/vendor.js:20786:26)在Subject.next(http:// localhost:8100/build/vendor)的RefCountSubscriber.Subscriber.next(http:// localhost:8100/build/vendor.js:20750:18). js:23237:25)在ConnectableSubscriber.Subscriber._next(http:// localhost:8100/build/vendor.js:20786:26)的ConnectableSubscriber.Subscriber.next(http:// localhost:8100/build/vendor. js:20750:18)在Asification.observe(http:// localhost:8100/build/vendor.js:51866:50)的AsyncAction.DelaySubscriber.dispatch(http:// localhost:8100/build/vendor.js: 76246:40)

home.ts

TypeError: Object(...) is not a function
    at SwitchMapSubscriber.project (http://localhost:8100/build/vendor.js:73935:76)
    at SwitchMapSubscriber._next (http://localhost:8100/build/vendor.js:61778:27)
    at SwitchMapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at RefCountSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26)
    at RefCountSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at Subject.next (http://localhost:8100/build/vendor.js:23237:25)
    at ConnectableSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26)
    at ConnectableSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18)
    at Notification.observe (http://localhost:8100/build/vendor.js:51866:50)
    at AsyncAction.DelaySubscriber.dispatch (http://localhost:8100/build/vendor.js:76246:40)
Run Code Online (Sandbox Code Playgroud)

home.html的 …

angularfire2 ionic3

13
推荐指数
1
解决办法
3万
查看次数

仅当ng服务--prod时AngularFire错误

我有一个Angular 8应用程序,使用npm包Angular Firebase(https://github.com/angular/angularfire2),当我使用Angular CLI命令构建应用程序并将其ng build --prod部署到主机时,出现以下Chrome浏览器控制台错误:

TypeError: Object(...)(...).auth is not a function
Run Code Online (Sandbox Code Playgroud)

如果我改用命令构建,ng build --prod --optimization=false则不会发生错误。

Angular CLI ng build选项optimization设置为true的情况导致AngularFire2 npm软件包错误。

我不确定如何进一步调试此问题。这是我的package.json文件:

    {
  "name": "bigmoenyshot",
  "version": "8.0.0",
  "license": "https://themeforest.net/licenses/terms/regular",
  "scripts": {
    "ng": "ng",
    "serve": "ng serve",
    "serveProd": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --prod --optimization=true",
    "build": "ng build --prod=true --aot=true --extractCss=true --optimization=true",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "deploy": "ng build --prod=true --aot=true --extractCss=true --optimization=false && firebase deploy"
  },
  "private": true, …
Run Code Online (Sandbox Code Playgroud)

firebase typescript angularfire angular

9
推荐指数
1
解决办法
572
查看次数