question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng build --prod --watch compiles app state before the save

See original GitHub issue

Description:

While running a build watch with the ‘–prod’ or ‘–aot’ options, the results to dist seem to be one save behind. Meaning, if I make a change and save, the change is detected and the project builds, however the results are the state of the app before the change. If I make another change, like adding a new line to a file, the change is detected and the project built, with the results of the previous save but not capturing the new lines added.

Note: This issue goes away if the ‘–prod’ or ‘–aot’ options are not used.

OS?

Windows 10

Versions.

@angular/cli: 1.0.0-beta.30 node: 6.9.5 os: win32 x64 @angular/common: 2.4.8 @angular/compiler: 2.4.8 @angular/core: 2.4.8 @angular/forms: 2.4.8 @angular/http: 2.4.8 @angular/platform-browser: 2.4.8 @angular/platform-browser-dynamic: 2.4.8 @angular/router: 3.4.8 @angular/cli: 1.0.0-beta.30 @angular/compiler-cli: 2.4.8

Repro steps.

ng new test-app ng build --prod --watch or ng build --aot --watch or ng build --prod --aot --watch

The log given by the failure.

None

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
filipesilvacommented, Mar 8, 2017

I investigated a bit more and this doesn’t seem to happen on all changes.

I can reproduce when changing a component template, but not when changing the component itself (changes are immediately reflected in this case).

So this seems related to the child compilers we use.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
angular - ng build --watch: what happens behind the scenes?
I have an Angular application where a lot of rebuilds are necessary, to avoid long build times I use a deamon like process...
Read more >
Watch and WatchOptions | webpack
Webpack can watch files and recompile whenever they change. This page explains how to enable this and a couple of tweaks you can...
Read more >
48 answers on StackOverflow to the most popular Angular ...
Importing lodash into angular2 + typescript application; How to detect a route ... ng build --prod (run in command line when directory is ......
Read more >
Use Angular with ASP.NET Core | Microsoft Learn
NET Core Single Page Application (SPA) project template for Angular ... Unlike the development build, the production build doesn't require ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found