I'm currently working on an Ionic project with AngularFire. I encountered a typescript error when trying to run
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. Please refer to 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)
Upon checking the node/node_modules/firebase/ directory of my project, I noticed that there is no firebase.d.ts
file, only an index.d.ts
.
This is the information about my Ionic setup:
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
The versions of Firebase and AngularFire2 I am using are "firebase": "~4.12.0"
and angularfire2": "~5.0.0-rc.6
.