Failed to build ionic PWA with --prod flag
See original GitHub issueDescribe the bug The package worked great in development but when build for release. Error occurred:
$ npm run ionic:build --prod
pj5@0.0.1 ionic:build /Users/user1/Documents/git/tomorrow/web/myapp-zqr ionic-app-scripts build
[18:50:42] ionic-app-scripts 3.1.2
[18:50:42] build prod started …
[18:50:42] clean started …
[18:50:42] clean finished in 9 ms
[18:50:42] copy started …
[18:50:42] deeplinks started …
[18:50:43] deeplinks finished in 268 ms
[18:50:43] ngc started …
[18:50:59] ngc finished in 16.25 s
[18:50:59] preprocess started …
[18:50:59] preprocess finished in less than 1 ms
[18:50:59] webpack started …
[18:50:59] copy finished in 16.86 s
[18:52:48] ionic-app-script task: “build”
[18:52:48] Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js Module build failed: TypeError: Cannot read
property ‘type’ of undefined at Object.getEffectiveTypeAnnotationNode
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:9341:18)
at assignContextualParameterTypes
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/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 @
./node_modules/@zxing/ngx-scanner/esm5/zxing-ngx-scanner.js @ ./src/pages/scan/scan.module.ngfactory.js @
./src lazy @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./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
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:9341:18)
at assignContextualParameterTypes
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock
(/Users/user1/Documents/git/tomorrow/web/myapp-zqr/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 @
./node_modules/@zxing/ngx-scanner/esm5/zxing-ngx-scanner.js @ ./src/pages/scan/scan.module.ngfactory.js @
./src lazy @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @
./src/app/main.ts
Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property ‘type’ of undefined
at Object.getEffectiveTypeAnnotationNode (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:9341:18)
at assignContextualParameterTypes (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/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
@ ./node_modules/@zxing/ngx-scanner/esm5/zxing-ngx-scanner.js
@ ./src/pages/scan/scan.module.ngfactory.js
@ ./src lazy
@ ./node_modules/ionic-angular/util/ng-module-loader.js
@ ./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 (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:9341:18)
at assignContextualParameterTypes (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/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
@ ./node_modules/@zxing/ngx-scanner/esm5/zxing-ngx-scanner.js
@ ./src/pages/scan/scan.module.ngfactory.js
@ ./src lazy
@ ./node_modules/ionic-angular/util/ng-module-loader.js
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts
at new BuildError (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at callback (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
at emitRecords.err (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/Compiler.js:368:12)
at next (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/Users/user1/Documents/git/tomorrow/web/myapp-zqr/node_modules/webpack/lib/Compiler.js:365:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! pj5@0.0.1 ionic:build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pj5@0.0.1 ionic:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /Users/gf/.npm/_logs/2018-09-11T16_52_48_173Z-debug.log
My version: Angular CLI: 6.0.7 Node: 8.11.1 OS: darwin x64 Angular: 5.0.1 … common, compiler, compiler-cli, core, forms, http … platform-browser, platform-browser-dynamic
Package Version
@angular-devkit/architect 0.6.7 (cli-only) @angular-devkit/build-optimizer 0.0.32 @angular-devkit/core 0.6.7 (cli-only) @angular-devkit/schematics 0.6.7 (cli-only) @schematics/angular 0.6.7 (cli-only) @schematics/update 0.6.7 (cli-only) rxjs 5.5.2 typescript 2.4.2 webpack 3.6.0
Additional context Without --prod, it works.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@odahcam Great! Really appreciated!!. Please keep up the great work. Can you please close the issue?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.