fix(ivy): ngcc - report an error if a target has missing dependencies (#31872)
Previously, we either crashed with an obscure error or silently did nothing. Now we throw an exception but with a helpful message. PR Close #31872
This commit is contained in:

committed by
Alex Rickabaugh

parent
57e15fc08b
commit
961d663fbe
@ -193,6 +193,13 @@ function getTargetedEntryPoints(
|
||||
const finder = new TargetedEntryPointFinder(
|
||||
fs, config, logger, resolver, basePath, absoluteTargetEntryPointPath, pathMappings);
|
||||
const entryPointInfo = finder.findEntryPoints();
|
||||
const invalidTarget = entryPointInfo.invalidEntryPoints.find(
|
||||
i => i.entryPoint.path === absoluteTargetEntryPointPath);
|
||||
if (invalidTarget !== undefined) {
|
||||
throw new Error(
|
||||
`The target entry-point "${invalidTarget.entryPoint.name}" has missing dependencies:\n` +
|
||||
invalidTarget.missingDependencies.map(dep => ` - ${dep}\n`));
|
||||
}
|
||||
if (entryPointInfo.entryPoints.length === 0) {
|
||||
markNonAngularPackageAsProcessed(fs, absoluteTargetEntryPointPath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user