Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

ng build --prod error #4521


User avatar
0
bolenton created

When I do a ng build, my project builds fine. However when I do a ng build --prod I get the following error. Does anybody have any idea why this is?

ERROR in ./node_modules/rxjs/_esm5/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:9341:18)
    at assignContextualParameterTypes (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:44563:16)
    at checkSourceElement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46742:28)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41990:21)
    at checkDeferredNodes (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46828:25)
    at checkSourceFileWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46863:17)
    at checkSourceFile (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46842:13)
    at Object.forEach (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:1506:30)
    at getDiagnosticsWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46924:16)
    at getDiagnostics (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46892:24)
    at Object.getEmitResolver (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:27162:13)
    at emitWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69722:69)
    at C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69687:66
    at runWithCancellationToken (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69779:24)
 @ ./node_modules/rxjs/_esm5/observable/bindNodeCallback.js 2:0-76
 @ ./node_modules/rxjs/_esm5/add/observable/bindNodeCallback.js
 @ ./node_modules/rxjs/_esm5/Rx.js
 @ ./src/account/login/validate-two-factor-code.component.ts
 @ ./src/account/account.module.ngfactory.js
 @ ./src/$$_lazy_route_resource lazy
 @ ./node_modules/@angular/core/esm5/core.js
 @ ./src/main.ts
 @ multi ./src/main.ts
ERROR in ./node_modules/rxjs/_esm5/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:9341:18)
    at assignContextualParameterTypes (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41948:29)
    at checkExpressionWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42959:28)
    at checkExpression (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42898:42)
    at checkExpressionCached (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:42779:38)
    at checkReturnStatement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:45418:54)
    at checkSourceElement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46763:28)
    at Object.forEach (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:1506:30)
    at checkBlock (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:44563:16)
    at checkSourceElement (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46742:28)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:41990:21)
    at checkDeferredNodes (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46828:25)
    at checkSourceFileWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46863:17)
    at checkSourceFile (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46842:13)
    at Object.forEach (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:1506:30)
    at getDiagnosticsWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46924:16)
    at getDiagnostics (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:46892:24)
    at Object.getEmitResolver (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:27162:13)
    at emitWorker (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69722:69)
    at C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69687:66
    at runWithCancellationToken (C:\Users\bolen\Desktop\Project Churnite\Churnite\angular\node_modules\typescript\lib\typescript.js:69779:24)
 @ ./node_modules/rxjs/_esm5/observable/bindCallback.js 2:0-68
 @ ./node_modules/rxjs/_esm5/add/observable/bindCallback.js
 @ ./node_modules/rxjs/_esm5/Rx.js
 @ ./src/account/login/validate-two-factor-code.component.ts
 @ ./src/account/account.module.ngfactory.js
 @ ./src/$$_lazy_route_resource lazy
 @ ./node_modules/@angular/core/esm5/core.js
 @ ./src/main.ts
 @ multi ./src/main.ts

3 Answer(s)