Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

DatePicker hydration ssr issue #19558

Description

@gboutte

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

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

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

  1. install ssr on the project ng add @angular/ssr
  2. Add DatePicker on the page
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Angular UniversalIssue or pull request is related to Angular Universal Server Side RenderingStatus: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleType: BugIssue contains a bug related to a specific component. Something about the component is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions