angular/angular · error · RuntimeError
MISSING_SSR_CONTENT_INTEGRITY_MARKER
MISSING_SSR_CONTENT_INTEGRITY_MARKER
Error message
Angular hydration logic detected that HTML content of this page was modified after it was produced during server side rendering. Make sure that there are no optimizations that remove comment nodes from HTML enabled on your CDN. Angular hydration relies on HTML produced by the server, including whitespaces and comment nodes.
What it means
Error "Angular hydration logic detected that HTML content of this page was modified after it was produced during server side rendering. Make sure that there are no optimizations that remove comment nodes from HTML enabled on your CDN. Angular hydration relies on HTML produced by the server, including whitespaces and comment nodes." thrown in angular/angular.
Source
Thrown at packages/core/src/hydration/utils.ts:801
// Check if the HTML parser may have moved the marker to just before the <body> tag,
// e.g. because the body tag was implicit and not present in the markup. An implicit body
// tag is unlikely to interfer with whitespace/comments inside of the app's root element.
// Case 1: Implicit body. Example:
// <!doctype html><head><title>Hi</title></head><!--nghm--><app-root></app-root>
const beforeBody = skipTextNodes(doc.body.previousSibling);
if (isSsrContentsIntegrity(beforeBody)) {
return;
}
// Case 2: Implicit body & head. Example:
// <!doctype html><head><title>Hi</title><!--nghm--><app-root></app-root>
let endOfHead = skipTextNodes(doc.head.lastChild);
if (isSsrContentsIntegrity(endOfHead)) {
return;
}
throw new RuntimeError(
RuntimeErrorCode.MISSING_SSR_CONTENT_INTEGRITY_MARKER,
typeof ngDevMode !== 'undefined' &&
ngDevMode &&
'Angular hydration logic detected that HTML content of this page was modified after it ' +
'was produced during server side rendering. Make sure that there are no optimizations ' +
'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' +
'relies on HTML produced by the server, including whitespaces and comment nodes.',
);
}
View on GitHub (pinned to 51cb07e980)
Solutions
- Disable CDN/hosting optimizations that strip comment nodes or whitespace from the SSR HTML.
When it happens
Trigger: Thrown at packages/core/src/hydration/utils.ts:801 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of angular/angular@51cb07e980 (2026-08-22).
Data as JSON: /api/errors/0eb5ade20bc2c9b9.
Report an issue: GitHub.