ng build --watch and ng serve don't always build updated files after new changes
See original GitHub issueI usually need to save changes multiple times in order for angular-cli to actually build files with those changes.
OS?
Ubuntu 16.10 x64
Versions.
angular-cli: 1.0.0-beta.28.3 node: 7.1.0 os: linux x64
Repro steps.
This happens for any angular-cli app I make, even fresh ones.
In the log below you can see the initial build when running ng build --watch
with Hash: 91bb893998276a59bbb3. Then I make a change to app.component.ts
and save it. Angular-cli responds with those next builds with the same Hash: 91bb893998276a59bbb3 which results in dist files without the new change. I go back to app.component.ts
and save again. Finally angular-cli responds with new Hash: 99e3be9aeef7c621e6f3 and the dist files include the new change.
The log given by the failure.
Hash: 91bb893998276a59bbb3
Time: 7868ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 3.94 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
Hash: 91bb893998276a59bbb3
Time: 625ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.map (main) 3.94 kB {3} [initial]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
Hash: 91bb893998276a59bbb3
Time: 594ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.map (main) 3.94 kB {3} [initial]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
Hash: 91bb893998276a59bbb3
Time: 568ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.map (main) 3.94 kB {3} [initial]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
Hash: 99e3be9aeef7c621e6f3
Time: 526ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.map (main) 3.97 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
Hash: 99e3be9aeef7c621e6f3
Time: 576ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 222 kB {4} [initial]
chunk {1} main.bundle.js, main.bundle.map (main) 3.97 kB {3} [initial]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 10 kB {4} [initial]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.38 MB [initial]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
Mention any other details that might be useful.
I thought this problem might be due to the Inotify Watches Limit on Linux that has been mentioned in some issues but setting it to 524288 does not fix the problem and it seems to me that angular-cli knows when the changes happen but doesn’t include them in the build for some reason. Also none of the directories have spaces or special characters in their name and webpack runs fine in other projects.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
This is a known issue, going back to “@ngtools/webpack” : “1.2.4” fixes the issue but you will lose the new perfomance improvements in building time of version 1.2.6 and up.
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.