You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: During hydration Angular expected a text node but found a comment node. #30125
ERROR RuntimeError: NG0500: During hydration Angular expected a text node but found a comment node.
Fully:
RuntimeError: NG0500: During hydration Angular expected a text node but found a comment node.
Angular expected this DOM:
#text(Home) <--ATTHISLOCATION…ActualDOMis:<ion-label_ngcontent-ng-c982784965=""><!-- --><--ATTHISLOCATION…</ion-label>
Note: attributes are only displayed to better represent the DOM but have no effect on hydration mismatches.
To fix this problem:
* check the "_AppComponent" component for hydration-related issues
* check to see if your template has valid HTML structure
* or skip hydration by adding the `ngSkipHydration` attribute to its host node in a template
Find more at https://angular.dev/errors/NG0500
at validateMatchingNode (core.mjs:15140:11)
at locateOrCreateTextNodeImpl (core.mjs:30741:16)
at Module.ɵɵtext (core.mjs:30715:22)
at AppComponent_Template (app.component.html:4:12)
at executeTemplate (core.mjs:12849:5)
at renderView (core.mjs:14018:7)
at renderComponent (core.mjs:13964:3)
at renderChildComponents (core.mjs:14064:5)
at renderView (core.mjs:14046:7)
at ComponentFactory.create (core.mjs:17381:9)
Verified on 9.0.7. ion-label puts an empty placeholder comment before its text so it can position slotted content. With provideClientHydration() on, Angular walks the server-rendered DOM, expects the text node Home first and finds that comment instead. #30958 fixed this as a side effect: it made Ionic hide the comment from DOM traversal, and it shipped in v8.7.18. The setup in this issue (standalone components, provideServerRendering() with no IonicServerModule) now hydrates without errors, including on a full page with a header, toolbar, content and list.
Upgrade @ionic/angular to 8.7.18 or later.
Angular's client hydration is still not supported in two other setups, which throw NG0500 or NG0502 on 9.0.7:
When Ionic components are rendered on the server with IonicServerModule from @ionic/angular-server.
When the app uses IonicModule instead of standalone components.
In both cases, skip hydration for the Ionic tree by adding ngSkipHydration to ion-app:
ngSkipHydration only works on a component's host element, so IonApp has to be in the component's imports (or come from IonicModule). Angular then renders everything inside ion-app again on the client instead of reusing the server DOM.
Activity
LBZC4600 commentedon Apr 27, 2025
Hi, what about this issue?
thetaPC commentedon Oct 7, 2026
Thanks for the report, and sorry for the delay.
Verified on 9.0.7.
ion-labelputs an empty placeholder comment before its text so it can position slotted content. WithprovideClientHydration()on, Angular walks the server-rendered DOM, expects the text nodeHomefirst and finds that comment instead. #30958 fixed this as a side effect: it made Ionic hide the comment from DOM traversal, and it shipped in v8.7.18. The setup in this issue (standalone components,provideServerRendering()with noIonicServerModule) now hydrates without errors, including on a full page with a header, toolbar, content and list.@ionic/angularto 8.7.18 or later.Angular's client hydration is still not supported in two other setups, which throw
NG0500orNG0502on 9.0.7:IonicServerModulefrom@ionic/angular-server.IonicModuleinstead of standalone components.In both cases, skip hydration for the Ionic tree by adding
ngSkipHydrationtoion-app:ngSkipHydrationonly works on a component's host element, soIonApphas to be in the component'simports(or come fromIonicModule). Angular then renders everything insideion-appagain on the client instead of reusing the server DOM.Closing this as fixed in 8.7.18.