fix(ngcc): don't crash on cyclic source-map references (#36452)
The source-map flattening was throwing an error when there is a cyclic dependency between source files and source-maps. The error was either a custom one describing the cycle, or a "Maximum call stack size exceeded" one. Now this is handled more leniently, resulting in a partially loaded source file (or source-map) and a warning logged. Fixes #35727 Fixes #35757 Fixes https://github.com/angular/angular-cli/issues/17106 Fixes https://github.com/angular/angular-cli/issues/17115 PR Close #36452
This commit is contained in:

committed by
Kara Erickson

parent
76a8cd57ae
commit
ee70a18a75
@ -36,7 +36,7 @@ export function renderSourceAndMap(
|
||||
{file: generatedPath, source: generatedPath, includeContent: true});
|
||||
|
||||
try {
|
||||
const loader = new SourceFileLoader(fs);
|
||||
const loader = new SourceFileLoader(fs, logger);
|
||||
const generatedFile = loader.loadSourceFile(
|
||||
generatedPath, generatedContent, {map: generatedMap, mapPath: generatedMapPath});
|
||||
|
||||
|
Reference in New Issue
Block a user