After setting up my Ionic 3 configuration with
@ionic/app-scripts: 3.1.1 typescript: 2.4.2
and installing the necessary dependencies
@angular/common: 5.0.1 @angular/compiler: 5.0.1 @angular/compiler-cli: 5.0.1 @angular/core: 5.0.1 @angular/forms: 5.0.1 @angular/http: 5.0.1 @angular/platform-browser: 5.0.1 @angular/platform-browser-dynamic: 5.0.1 @ionic-native/call-number: ^4.5.2 @ionic-native/camera: ^4.5.2 @ionic-native/core: 4.3.1 @ionic-native/splash-screen: 4.4.0 @ionic-native/status-bar: 4.4.0 @ionic/app-scripts: 3.1.1 @ionic/storage: 2.1.3
My Ionic 3 project successfully builds using the commands:
ionic cordova build --release android
ionic cordova build android
However, when attempting:
ionic cordova build android --prod --release
ionic cordova build android --release --prod
An error is generated showing:
Error: ./node_modules/Rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (typescript.js:9341:17)
at assignContextualParameterTypes (typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (typescript.js:41948:29)
at checkExpressionWorker (typescript.js:42959:28)
at checkExpression (typescript.js:42898:42)
at checkExpressionCached (typescript.js:42779:38)
at checkReturnStatement (typescript.js:45418:54)
at checkSourceElement (typescript.js:46763:28)
at Object.forEach (typescript.js:1506:30)
at checkBlock (typescript.js:44563:16)