angular/packages/compiler-cli/ngcc/test
George Kalpakas 06ff277b60 fix(ngcc): do not fail hard when a format-path points to a non-existing or empty file (#40985)
Previously, when `ngcc` encountered an entry-point with a format-path
that pointed to a non-existing or empty file it would throw an error and
stop processing the remaining tasks.

In the past, we used to ignore such format-paths and continue processing
the rest of the tasks ([see code][1]). This was changed to a hard
failure in 2954d1b5ca. Looking at the code
history, the reason for changing the behavior was an (incorrect)
assumption that the condition could not fail. This assumption failed to
take into account the case where a 3rd-party library has an invalid
format-path in its `package.json`. This is an issue with the library,
but it should not prevent `ngcc` from processing other
packages/entry-points/formats.

This commit fixes this by reporting the task as failed but not throwing
an error, thus allowing `ngcc` to continue processing other tasks.

[1]: https://github.com/angular/angular/blob/3077c9a1f89c5bd75fb96c16e/packages/compiler-cli/ngcc/src/main.ts#L124

Fixes #40965

PR Close #40985
2021-02-26 08:26:34 -08:00
..
analysis fix(compiler-cli): remove the concept of an errored trait (#39923) 2020-12-03 13:42:13 -08:00
dependencies test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
entry_point_finder fix(compiler-cli): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:46 -08:00
execution refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
helpers refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
host fix(compiler-cli): remove the concept of an errored trait (#39923) 2020-12-03 13:42:13 -08:00
integration fix(ngcc): do not fail hard when a format-path points to a non-existing or empty file (#40985) 2021-02-26 08:26:34 -08:00
locking fix(compiler-cli): ngcc - remove outdated link (#40285) 2021-01-06 07:10:39 -08:00
migrations test(compiler-cli): move testing utils to separate package (#39594) 2020-11-17 11:59:56 -08:00
packages refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
rendering fix(compiler-cli): set TS original node on imported namespace identifiers (#40711) 2021-02-11 15:58:25 -08:00
writing refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
BUILD.bazel fix(compiler-cli): update ngcc integration tests for latest changes in rules_nodejs (#40710) 2021-02-09 10:48:46 -08:00
ngcc_options_spec.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
utils_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00