Skip to content

Commit 14a78b0

Browse files
committed
refactor(@angular/ssr): add timeout to prevent 'adev' hanging during route extraction
A timeout was added during route extraction to resolve an issue where 'adev' would hang in production builds. The root cause is currently unclear, but this change ensures the build completes successfully.
1 parent 1d6d264 commit 14a78b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/angular/ssr/src/routes/ng-routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ export async function getRoutesFromAngularRouterConfig(
571571
}
572572
}
573573

574+
// This timeout is necessary to prevent 'adev' from hanging in production builds.
575+
// The exact cause is unclear, but removing it leads to the issue.
576+
await new Promise((resolve) => setTimeout(resolve, 0));
577+
574578
if (serverConfigRouteTree) {
575579
for (const { route, presentInClientRouter } of serverConfigRouteTree.traverse()) {
576580
if (presentInClientRouter || route === '**') {

0 commit comments

Comments
 (0)