From 2caa4199901d83f56514cb9fbae843760856d5c1 Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 29 Jan 2019 11:47:01 +0000 Subject: [PATCH] fix(compiler-cli): don't throw when listing lazy routes for an entry route (#28372) In https://github.com/angular/angular/pull/27697 the listLazyRoutes was fixed to work with ivy. Since the entryRoute argument is not supported, it was made to also error. But by erroring it breaks existing usage with Angular CLI where the entry route is sent in as an argument. This commit changes listLazyRoutes to not error out, but instead ignore the argument. PR Close #28372 --- packages/compiler-cli/src/ngtsc/program.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/program.ts b/packages/compiler-cli/src/ngtsc/program.ts index 2f379e87fc..4fff26776c 100644 --- a/packages/compiler-cli/src/ngtsc/program.ts +++ b/packages/compiler-cli/src/ngtsc/program.ts @@ -191,11 +191,9 @@ export class NgtscProgram implements api.Program { } listLazyRoutes(entryRoute?: string|undefined): api.LazyRoute[] { - if (entryRoute !== undefined) { - throw new Error( - `Listing specific routes is unsupported for now (got query for ${entryRoute})`); - } this.ensureAnalyzed(); + // Listing specific routes is unsupported for now, so we erroneously return + // all lazy routes instead (which should be okay for the CLI's usage). return this.routeAnalyzer !.listLazyRoutes(); }