From 7f44fa65a7c3bd1c213e273698f49463b0dc9a56 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 28 Jan 2020 10:13:08 +0000 Subject: [PATCH] fix(ngcc): improve lockfile error message (#35001) The message now gives concrete advice to developers who experience the error due to running multiple simultaneous builds via webpack. Fixes #35000 PR Close #35001 --- packages/compiler-cli/ngcc/src/execution/lock_file.ts | 2 ++ packages/compiler-cli/ngcc/test/execution/lock_file_spec.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/compiler-cli/ngcc/src/execution/lock_file.ts b/packages/compiler-cli/ngcc/src/execution/lock_file.ts index 1bb0ce7273..30efb22f46 100644 --- a/packages/compiler-cli/ngcc/src/execution/lock_file.ts +++ b/packages/compiler-cli/ngcc/src/execution/lock_file.ts @@ -75,6 +75,8 @@ export class LockFile { throw new Error( `ngcc is already running at process with id ${pid}.\n` + + `If you are running multiple builds in parallel then you should pre-process your node_modules via the command line ngcc tool before starting the builds;\n` + + `See https://v9.angular.io/guide/ivy#speeding-up-ngcc-compilation.\n` + `(If you are sure no ngcc process is running then you should delete the lockfile at ${this.lockFilePath}.)`); } } diff --git a/packages/compiler-cli/ngcc/test/execution/lock_file_spec.ts b/packages/compiler-cli/ngcc/test/execution/lock_file_spec.ts index 3d09e68082..78da66fae0 100644 --- a/packages/compiler-cli/ngcc/test/execution/lock_file_spec.ts +++ b/packages/compiler-cli/ngcc/test/execution/lock_file_spec.ts @@ -183,6 +183,8 @@ runInEachFileSystem(() => { expect(() => lockFile.create()) .toThrowError( `ngcc is already running at process with id 188.\n` + + `If you are running multiple builds in parallel then you should pre-process your node_modules via the command line ngcc tool before starting the builds;\n` + + `See https://v9.angular.io/guide/ivy#speeding-up-ngcc-compilation.\n` + `(If you are sure no ngcc process is running then you should delete the lockfile at ${lockFile.lockFilePath}.)`); }); });