mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +08:00
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.
This commit is contained in:
parent
1d6d264960
commit
78c41f67ec
@ -571,6 +571,10 @@ export async function getRoutesFromAngularRouterConfig(
|
||||
}
|
||||
}
|
||||
|
||||
// This timeout is necessary to prevent 'adev' from hanging in production builds.
|
||||
// The exact cause is unclear, but removing it leads to the issue.
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
|
||||
if (serverConfigRouteTree) {
|
||||
for (const { route, presentInClientRouter } of serverConfigRouteTree.traverse()) {
|
||||
if (presentInClientRouter || route === '**') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user