We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d9f7d43 commit 21549bdCopy full SHA for 21549bd
packages/angular_devkit/build_angular/src/utils/routes-extractor/extractor.ts
@@ -117,10 +117,15 @@ export async function* extractRoutes(
117
118
const injector = applicationRef.injector;
119
const router = injector.get(Router);
120
- const compiler = injector.get(Compiler);
121
122
- // Extract all the routes from the config.
123
- yield* getRoutesFromRouterConfig(router.config, compiler, injector);
+ if (router.config.length === 0) {
+ // In case there are no routes available
+ yield { route: '', success: true, redirect: false };
124
+ } else {
125
+ const compiler = injector.get(Compiler);
126
+ // Extract all the routes from the config.
127
+ yield* getRoutesFromRouterConfig(router.config, compiler, injector);
128
+ }
129
} finally {
130
platformRef.destroy();
131
}
0 commit comments