Open kusmierczykw opened 2 weeks ago
The workaround for this example is use:
public readonly isBrowser = isPlatformBrowser(this.platformId);
public constructor(
private readonly navigator: NavigatorService,
@Inject(PLATFORM_ID) private readonly platformId: object,
) {}
and
@if (isBrowser) {
<p-dialog
[visible]="true">
This is example content.
</p-dialog>
}
But this does not change the fact that DomHandler does not support SSR.
Describe the bug
There is a problem with support SSR by the DomHandler. I try to open dialog on enter to concrete page in the app but the app crashes. The same problem is with Sidebar component.
Reproducer
https://stackblitz.com/edit/stackblitz-starters-cjg9pe?file=src%2Fapp%2Fapp.component.html
Angular version
SSR
PrimeNG version
17.14.1
Build / Runtime
Angular CLI App
Language
TypeScript
Steps to reproduce the behavior
Add simple fragment of code to the app.component.html file:
and run app with SSR mode.
The app carshes with the following error:
Expected behavior
Support SSR by the DomHandler.