File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
packages/angular/ssr/src/routes Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -522,11 +522,19 @@ export async function getRoutesFromAngularRouterConfig(
522522 applicationRef = await bootstrap ( ) ;
523523 }
524524
525+ const injector = applicationRef . injector ;
526+ const router = injector . get ( Router ) ;
527+
528+ // Workaround to unblock navigation when `withEnabledBlockingInitialNavigation()` is used.
529+ // This is necessary because route extraction disables component bootstrapping.
530+ setTimeout ( ( ) => {
531+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
532+ ( router as any ) . navigationTransitions . afterPreactivation ( ) ?. next ?.( ) ;
533+ } , 0 ) ;
534+
525535 // Wait until the application is stable.
526536 await applicationRef . whenStable ( ) ;
527537
528- const injector = applicationRef . injector ;
529- const router = injector . get ( Router ) ;
530538 const routesResults : RouteTreeNodeMetadata [ ] = [ ] ;
531539 const errors : string [ ] = [ ] ;
532540
You can’t perform that action at this time.
0 commit comments