{"record":{"id":"5a406001eb5db160","repo":"angular/angular","slug":"ng0506","errorCode":"NG0506","errorMessage":"Angular hydration expected the ApplicationRef.isStable() to emit `true`, but it didn't happen within ${time}ms. Angular hydration logic depends on the application becoming stable as a signal to complete hydration process.","messagePattern":"Angular hydration expected the ApplicationRef\\.isStable\\(\\) to emit `true`, but it didn't happen within (.+?)ms\\. Angular hydration logic depends on the application becoming stable as a signal to complete hydration process\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/hydration/api.ts","lineNumber":397,"sourceCode":"        multi: true,\n      },\n    );\n  }\n\n  return providers;\n}\n\n/**\n *\n * @param time The time in ms until the stable timedout warning message is logged\n */\nfunction logWarningOnStableTimedout(time: number, console: Console): void {\n  const message =\n    `Angular hydration expected the ApplicationRef.isStable() to emit \\`true\\`, but it ` +\n    `didn't happen within ${time}ms. Angular hydration logic depends on the application becoming stable ` +\n    `as a signal to complete hydration process.`;\n\n  console.warn(formatRuntimeError(RuntimeErrorCode.HYDRATION_STABLE_TIMEDOUT, message));\n}\n","sourceCodeStart":379,"sourceCodeEnd":399,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/core/src/hydration/api.ts#L379-L399","documentation":"NG0506: after hydration begins, Angular waits for ApplicationRef.isStable() to emit true (i.e., no pending tasks) to finish the hydration process, guarded by a timeout of APPLICATION_IS_STABLE_TIMEOUT = 10_000 ms (packages/core/src/hydration/api.ts:85). If the application never becomes stable within 10 seconds, this warning fires — hydration may still complete later, but something is keeping the app permanently unstable.","triggerScenarios":"An app that never settles: a never-completing RxJS stream piped through async pipe, an interval timer running inside the Angular zone, a PendingTask never removed, pending HTTP requests that hang, or an APP_INITIALIZER that never resolves — all while hydration is enabled.","commonSituations":"Polling loops (setInterval in zone), realtime websocket subscriptions registered as pending tasks, a forgotten task added via PendingTasks and never completed, or long initial data loads exceeding 10 seconds on slow networks.","solutions":["Find the task keeping the app unstable: check ApplicationRef.isStable()/whenStable(), pending tasks via provideStabilityDebugging, and the PendingTasks service","Move long-lived or periodic work outside change detection (NgZone.runOutsideAngular) or stop registering it as a pending task","Complete/cancel infinite observables or gate them so the app can settle initially, then restart them after hydration"],"exampleFix":"// before\nstartPolling() {\n  this.zone.run(() => setInterval(() => this.poll(), 1000)); // keeps app unstable forever\n}\n\n// after\nstartPolling() {\n  this.zone.runOutsideAngular(() => setInterval(() => this.poll(), 1000));\n}","handlingStrategy":"validation","validationCode":"// Surface never-stable apps before hydration times out at 10s\nconst appRef = injector.get(ApplicationRef);\nfirstValueFrom(appRef.isStable().pipe(filter(Boolean), timeout(9000)))\n  .catch(() => console.warn('App unstable >9s — investigate pending tasks before enabling hydration'));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave infinite intervals or unsubscribed realtime streams running inside the Angular zone","Complete or remove PendingTasks registrations once their work finishes","Ensure APP_INITIALIZER and initial HTTP requests can finish within the 10-second hydration window"],"tags":["angular","hydration","ssr","stability","pending-tasks"],"backgroundTag":"application-never-stable","analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}