fix(ivy): ngcc - handle missing entry-point dependencies better (#30270)

If an entry-point has a missing dependency then all the entry-points
that would have pointed to that dependency are also removed from
the dependency graph.

Previously we were still processing the dependencies of an entry-point
even if it had already been removed from the graph because it depended
upon a missing dependency that had previously been removed due to another
entry-point depending upon it.

This caused the dependency processing to crash rather than gracefully
logging and handling the missing invalid entry-point.

Fixes #29624

PR Close #30270
This commit is contained in:
Pete Bacon Darwin
2019-05-05 14:39:50 +01:00
committed by Kara Erickson
parent f5b2ae616f
commit c59717571e
2 changed files with 7 additions and 5 deletions

View File

@ -128,9 +128,11 @@ export class DependencyResolver {
} else {
dependencies.forEach(dependencyPath => {
if (graph.hasNode(dependencyPath)) {
// The dependency path maps to an entry point that exists in the graph
// so add the dependency.
graph.addDependency(entryPoint.path, dependencyPath);
if (graph.hasNode(entryPoint.path)) {
// The entry-point is still valid (i.e. has no missing dependencies) and
// the dependency maps to an entry point that exists in the graph so add it
graph.addDependency(entryPoint.path, dependencyPath);
}
} else if (invalidEntryPoints.some(i => i.entryPoint.path === dependencyPath)) {
// The dependency path maps to an entry-point that was previously removed
// from the graph, so remove this entry-point as well.