简体   繁体   中英

issue with “ ionic cordova build android --prod --release”

I have created a chat application using Ionic2. When i tried to take production build using ionic cordova build android --prod --release , I am getting the following error.

    Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:9341:17)
    at assignContextualParameterTypes (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (C:\Users\cool\Desktop\Chat\SideMenu\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/providers/apis/apis.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,./node_modules/rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:9341:17)
    at assignContextualParameterTypes (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (C:\Users\cool\Desktop\Chat\SideMenu\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/providers/apis/apis.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts
    at BuildError.Error (native)
    at new BuildError (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at callback (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\@ionic\app-scripts\dist\webpack.js:121:28)
    at emitRecords.err (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\webpack\lib\Compiler.js:269:13)
at Compiler.emitRecords (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\webpack\lib\Compiler.js:375:38)
    at emitAssets.err (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\webpack\lib\Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\webpack\lib\Compiler.js:368:12)
    at next (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\tapable\lib\Tapable.js:218:11)
    at Compiler.compiler.plugin (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\webpack\lib\performance\SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:\Users\cool\Desktop\Chat\SideMenu\node_modules\tapable\lib\Tapable.js:222:13)

Ionic Info

cli packages: (C:\Users\cool\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.10.3
npm               : 3.10.10
OS                : Windows 8.1

Please help me to solve this error. I have seen some similar questions but nothing helped me to solve this.

尝试@ Und3rTow提到的文档中指定的以下步骤

npm install typescript@latest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM