Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR: ResizeObserver is not defined #61

Open
schulzi66 opened this issue Mar 10, 2022 · 2 comments
Open

SSR: ResizeObserver is not defined #61

schulzi66 opened this issue Mar 10, 2022 · 2 comments

Comments

@schulzi66
Copy link

When serving an angular application with SSR, the directive breaks the application, due to the following error:
ReferenceError: ResizeObserver is not defined

It seems that the error occours in the constructor of the directive.

@schulzi66
Copy link
Author

A solution would be to use the isPlatformServer() from @angular/common to check if the application is running in SSR and if so, not initialize the ResizeObserver

@cotz1995
Copy link

cotz1995 commented May 4, 2022

I'm also experiencing this issue when using prerendering.

It looks like this is solved in #62

EDIT: added link to solution PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants