Skip to content

Build fails in --prod mode #8615

Closed
Closed

Description

@darkbasic

Versions

$ ng --version

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
    
Angular CLI: 1.5.4 (e)
Node: 9.2.0
OS: linux x64
Angular: 5.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.7
typescript-extends: 1.0.1
typescript: 2.4.2
webpack-concat-plugin: 1.4.0
webpack-dev-server: 2.9.4
webpack: 3.8.1

Repro steps

Observed behavior

ERROR in ./node_modules/rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:9341:18)
    at assignContextualParameterTypes (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:41948:29)
    at checkExpressionWorker (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:42959:28)
    at checkExpression (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:42898:42)
    at checkExpressionCached (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:42779:38)
    at checkReturnStatement (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:45418:54)
    at checkSourceElement (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:46763:28)
    at Object.forEach (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:1506:30)
    at checkBlock (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:44563:16)
    at checkSourceElement (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:46742:28)
    at checkFunctionExpressionOrObjectLiteralMethodDeferred (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:41990:21)
    at checkDeferredNodes (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:46828:25)
    at checkSourceFileWorker (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:46863:17)
    at checkSourceFile (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:46842:13)
    at Object.forEach (/home/niko/WebstormProjects/angularcli-meteor/node_modules/typescript/lib/typescript.js:1506:30)
 @ ./node_modules/rxjs/observable/bindNodeCallback.js 2:36-76
 @ ./node_modules/rxjs/add/observable/bindNodeCallback.js
 @ ./node_modules/rxjs/Rx.js
 @ ./node_modules/meteor-rxjs/dist/ObservableCollection.js
 @ ./node_modules/meteor-rxjs/dist/index.js
 @ ./api/server/collections/chats.ts
 @ ./api/server/collections/index.ts
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/main.ts
 @ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts

Desired behavior

Should compile the code. Older versions of angular-cli did work fine. See the master branch here which uses 1.4.7: https://github.com/darkbasic/angularcli-meteor

Mention any other details that might be useful (optional)

The code works fine without --prod.

Activity

  1. iursevla commented on Nov 23, 2017

    @iursevla

    Same issue but using BehaviorSubject

  2. self-assigned this
    on Nov 24, 2017
  3. jasperbosch commented on Nov 24, 2017

    @jasperbosch

    I noticed that in the folder 'node_modules@angular-devkit\build-optimizer' there was no 'node_modules' folder.
    When copying that folder from an other project my 'ng build --prod' succeeds.

    Maybe this helps in solving the problem.

  4. filipesilva commented on Nov 25, 2017

    @filipesilva
    Contributor

    This issue is a duplicate of #8615 I believe, and should be fixed when angular/devkit#299 is merged.

  5. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs: investigationRequires some digging to determine if action is needed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions