Repository navigation
Build --watch intermittent failures with non changing assets on Windows #4191
Description
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 8
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.25.5
node: 6.9.2
os: win32 x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4
@angular/compiler-cli: 2.4.4
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
It's intermittent when running a watch build in a relatively complex site (several modules, many asset files, etc).
The command looks like this, but since it's intermittent, I cannot reproduce it all the time (After several rebuilds, when modifying the same file several times, it just sometimes breaks).
ng build --progress false --verbose false -o dist --bh "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/some/path/"
(It's an npm script)
The log given by the failure.
Normally this include a stack trace and some more information.
In consoles, anonymized (sorry):
Error: EBUSY: resource busy or locked, open 'D:\project-root\dist\bin\some-asset-file.dll'
at Error (native)
D:\project-root\node_modules\angular-cli\tasks\build-webpack-watch.js:31
if (stats.hash !== lastHash) {
^
TypeError: Cannot read property 'hash' of null
at Watching.handler (D:\project-root\node_modules\angular-cli\tasks\build-webpack-watch.js:31:26)
at Watching._done (D:\project-root\node_modules\webpack\lib\Compiler.js:96:7)
at D:\project-root\node_modules\webpack\lib\Compiler.js:56:25
at Compiler.<anonymous> (D:\project-root\node_modules\webpack\lib\Compiler.js:333:19)
at D:\project-root\node_modules\async\dist\async.js:356:16
at iteratorCallback (D:\project-root\node_modules\async\dist\async.js:934:13)
at D:\project-root\node_modules\async\dist\async.js:840:16
at fs.js:1305:7
at FSReqWrap.oncomplete (fs.js:123:15)
Mention any other details that might be useful.
It's worth noting that the file D:\project-root\dist\bin\some-asset-file.dll has not changed, and is not what's being modified in that case.
Also worth noting that I have mcAfee on that machine, which in the past caused famous NPM install rename issue.
Note:
I plan to create a simple PR for this, changing build-webpack-watch where it says:
if (stats.hash !== lastHash) {
lastHash = stats.hash;
process.stdout.write(stats.toString(statsConfig) + '\n');
}
to also check if stats is not null.
I hope that will be enough, but thought would open issue first to justify the change, and get other advice if it's more than this.
Thanks! We'll be in touch soon.
Activity
Meligy commentedon Jan 24, 2017
Additional note: The triggering asset file seems to be different every time (kinda expected).
Also worth saying In this scenario no source asset files change at all.
Meligy commentedon Feb 6, 2017
The code that's causing this has changed a lot, and I'm not seeing this anymore.
I got the issue with file changes triggering rebuild without changing output in beta.28 though but that doesn't seem to be happening after installing beta.30 and doing
npm update(I'm, lying, it'syarn upgrade), which is working, except it's showing the Webpack loader deprecation warnings, which are fixed in master, but long story short, this issue is now outdated and irrelevant.angular-automatic-lock-bot commentedon Sep 6, 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.