Firebase JS SDK缺少firebase.d.ts。运行离子发送时的Typescript错误

时间:2018-03-21 06:43:01

标签: typescript firebase ionic-framework angularfire2 typescript-typings

我正在使用AngularFire运行离子项目。运行

时出现打字稿错误

ionic cordova build --prod --release android

typescript error '/home/sebinbenjamin/workspace/myapp/node_modules/firebase/firebase.d.ts' not found.

    Error: The Angular AoT build failed. See the issues above
        at /home/sebinbenjamin/workspace/myapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:232:55
        at step (/home/sebinbenjamin/workspace/myapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:32:23)
        at Object.next (/home/sebinbenjamin/workspace/myapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:13:53)
        at fulfilled (/home/sebinbenjamin/workspace/myapp/node_modules/@ionic/app-scripts/dist/aot/aot-compiler.js:4:58)

检查项目node / node_modules / firebase /目录时,没有firebase.d.ts,只有index.d.ts

这是我的离子信息:

ionic info
cli packages: (/usr/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v6.13.1
    npm               : 3.10.10
    OS                : Linux 4.4

Environment Variables:

    ANDROID_HOME : /home/sebinbenjamin/Android/Sdk

Misc:

    backend : pro

我正在使用"firebase": "~4.12.0"angularfire2": "~5.0.0-rc.6

1 个答案:

答案 0 :(得分:1)

一个临时解决方案是将index.d.ts重命名为firebase.d.ts,这似乎不会导致其他错误。