Skip to content

Inconsistent results from "ng build --watch" #12311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TimWebb opened this issue Sep 19, 2018 · 1 comment · Fixed by #12418
Closed

Inconsistent results from "ng build --watch" #12311

TimWebb opened this issue Sep 19, 2018 · 1 comment · Fixed by #12418

Comments

@TimWebb
Copy link

TimWebb commented Sep 19, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

~/Development/test-fromdev/angularcli622 (master)
$ node --version
v10.10.0

~/Development/test-fromdev/angularcli622 (master)
$ npm --version
6.4.1

~/Development/test-fromdev/angularcli622 (master)
$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 6.2.2
Node: 10.10.0
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.8.2
@angular-devkit/build-angular     0.8.2
@angular-devkit/build-optimizer   0.8.2
@angular-devkit/build-webpack     0.8.2
@angular-devkit/core              0.8.2
@angular-devkit/schematics        0.8.2
@angular/cli                      6.2.2
@ngtools/webpack                  6.2.2
@schematics/angular               0.8.2
@schematics/update                0.8.2
rxjs                              6.2.2
typescript                        2.9.2
webpack                           4.19.1

Repro steps

In short:

  1. ng new
  2. Modify export class AppComponent in app.component.ts and make the name have an error
  3. ng build --watch
  4. Results do not include complete errors
  5. Modify a file and save it
  6. Results get different results

screen shot 2018-09-19 at 10 03 06 am

The log given by the failure

Date: 2018-09-19T16:23:50.988Z
Hash: c698bdcfe9b051ff11cf
Time: 3469ms
chunk {main} main.js, main.js.map (main) 640 bytes [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 695 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 15.6 kB [initial] [rendered]

ERROR in AppComponent cannot be used as an entry component.

Desired functionality

Correctly report details on the file with errors. We were tying in Angular CLI build with VS Code tasks support to get 'authoritative' project-level validation and ideally need consistent reporting of errors (and bonus would be "begin compile" / "end compile" designators).

Mention any other details that might be useful

@alan-agius4 alan-agius4 added feature Issue that requests a new feature area: @angular-devkit/build-angular labels Sep 20, 2018
@ngbot ngbot bot added this to the Backlog milestone Sep 20, 2018
@alan-agius4 alan-agius4 removed the feature Issue that requests a new feature label Sep 20, 2018
@ngbot ngbot bot modified the milestones: Backlog, needsTriage Sep 20, 2018
@alan-agius4 alan-agius4 added the needs: investigation Requires some digging to determine if action is needed label Sep 20, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Sep 20, 2018
kyliau pushed a commit that referenced this issue Oct 23, 2018
* fix(@ngtools/webpack): emit lazy routes errors on rebuilds

At the moment lazy route errors are only emitted in the initial builds because in following builds we are only processed lazy routes that are declared in the changed files.

At the moment, we cannot cache the previously resolved routes as there is no way to track in which file the lazy route was declared so that we can bust the lazy route if it was removed.

Closes #12236

* test: add test for compilation errors in watch mode

Closes #12311
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
…2418)

* fix(@ngtools/webpack): emit lazy routes errors on rebuilds

At the moment lazy route errors are only emitted in the initial builds because in following builds we are only processed lazy routes that are declared in the changed files.

At the moment, we cannot cache the previously resolved routes as there is no way to track in which file the lazy route was declared so that we can bust the lazy route if it was removed.

Closes angular#12236

* test: add test for compilation errors in watch mode

Closes angular#12311
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants