1
votes

My ionic 3 config is "@ionic/app-scripts": "3.1.1", "typescript": "2.4.2"

and dependencies are

"@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 build successfully with

ionic cordova build --release android and
ionic cordova build android

But

ionic cordova build android --prod --release and 
ionic cordova build android --release --prod

doesn't build, it generates error as

Error: ./node_modules/Rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:9341:17)
at assignContextualParameterTypes 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42959:28)
at checkExpression 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42898:42)
at checkExpressionCached 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42779:38)
at checkReturnStatement 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:45418:54)
at checkSourceElement 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:46763:28)
at Object.forEach 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:1506:30)
at checkBlock 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:44563:16)
 @ ./node_modules/Rxjs/observable/bindNodeCallback.js 2:36-76
 @ ./node_modules/Rxjs/add/observable/bindNodeCallback.js
 @ ./node_modules/Rxjs/rx.js
 @ ./src/pages/page3/page3.ts
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,./node_modules/Rxjs/observable/BoundCallbackObservable.js
 Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:9341:17)
at assignContextualParameterTypes 
 (C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42959:28)
at checkExpression 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42898:42)
at checkExpressionCached 
 (C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:42779:38)
at checkReturnStatement 
 (C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:45418:54)
at checkSourceElement 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:46763:28)
at Object.forEach 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:1506:30)
at checkBlock 
(C:\Users\JOHN\demoapp\node_modules\typescript\lib\typescript.js:44563:16)
 @ ./node_modules/Rxjs/observable/bindCallback.js 2:32-68
 @ ./node_modules/Rxjs/add/observable/bindCallback.js
 @ ./node_modules/Rxjs/rx.js
 @ ./src/pages/page3/page3.ts
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
at callback (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
at emitRecords.err (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\node_modules\webpack\lib\Compiler.js:265:13)
at Compiler.emitRecords (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\node_modules\webpack\lib\Compiler.js:371:38)
at emitAssets.err (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\node_modules\webpack\lib\Compiler.js:258:10)
at applyPluginsAsyncSeries1.err (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\node_modules\webpack\lib\Compiler.js:364:12)
at next (C:\Users\JOHN\demoapp\node_modules\tapable\lib\Tapable.js:218:11)
at Compiler.compiler.plugin (C:\Users\JOHN\demoapp\node_modules\@ionic\app-scripts\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (C:\Users\JOHN\demoapp\node_modules\tapable\lib\Tapable.js:222:13)
1
Could you show your package.json?Sampath

1 Answers

2
votes

You need to use @ionic/app-scripts 3.1.1. That was a bug on 3.1.0.

You can see it here