Describe the bug
The datepicker is not working in SSR.
If the page contain a datepicker, when you load the page you get an hydration error:
Error: NG0502: During serialization, Angular was unable to find an element in the DOM:
<div class="p-componentp-datepicker-panel" id="pn_id_3_panel" aria-label="ChooseDate" role="dialog" aria-modal="true" data-pc-section="panel">
…
#node(projection)
<!-- container --> <-- AT THIS LOCATION
…
</div>
To fix this problem:
* check corresponding component for hydration-related issues
* check to see if your template has valid HTML structure
* check if there are any third-party scripts that manipulate the DOM. More info: https://v21.angular.dev/guide/hydration#third-party-scripts-with-dom-manipulation
* or skip hydration by adding the `ngSkipHydration` attribute to its host node in a template
Find more at https://v21.angular.dev/errors/NG0502
at new RuntimeError (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:2980:5)
at nodeNotFoundError (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:11964:9)
at calcPathForNode (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:12614:13)
at appendSerializedNodePath (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26637:33)
at serializeLView (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26724:11)
at annotateHostElementForHydration (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26763:17)
at serializeLView (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26712:9)
at annotateHostElementForHydration (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26763:17)
at annotateComponentLViewForHydration (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26458:12)
at annotateForHydration (/home/projects/faewbyyz/.angular/vite-root/example-app/main.server.mjs:26505:9)
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/faewbyyz-7p1fc37s?file=src%2Fapp%2Fdatepicker-basic-demo.ts
Environment
Mac os 26.2, chrome 147
Angular version
21
PrimeNG version
v21
Node version
24
Browser(s)
No response
Steps to reproduce the behavior
- install ssr on the project
ng add @angular/ssr
- Add DatePicker on the page
- Refresh
I took the first date picker stackblitz on the page https://primeng.org/datepicker, and run the ssr command to install SSR, and I get the error.
Expected behavior
The page should load correctly without issue
Describe the bug
The datepicker is not working in SSR.
If the page contain a datepicker, when you load the page you get an hydration error:
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/faewbyyz-7p1fc37s?file=src%2Fapp%2Fdatepicker-basic-demo.ts
Environment
Mac os 26.2, chrome 147
Angular version
21
PrimeNG version
v21
Node version
24
Browser(s)
No response
Steps to reproduce the behavior
ng add @angular/ssrI took the first date picker stackblitz on the page https://primeng.org/datepicker, and run the ssr command to install SSR, and I get the error.
Expected behavior
The page should load correctly without issue