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 with CDK Virtual Scroll: ResizeObserver is not defined error thrown #603

Closed
kanehjeong opened this issue Jun 7, 2024 · 2 comments · Fixed by #602
Closed

SSR with CDK Virtual Scroll: ResizeObserver is not defined error thrown #603

kanehjeong opened this issue Jun 7, 2024 · 2 comments · Fixed by #602

Comments

@kanehjeong
Copy link

This happened when upgrading to ngx-scrollbar 15 and swapping out the scrollViewport for the externalViewport with the cdkVirtualScrollViewport as mentioned in this integration docs here. This is assumed to be because ResizeObserver is being used somewhere without properly handling a case where the scroll is rendered server side.

Everything works fine once it is hydrated through CSR on the browser, so it's really just a minor inconvenience with the error logging.

Reproduction

Couldn't easily add @angular/ssr in the StackBlitz, but I've uploaded a screen shot of the code here.

Screenshot 2024-06-06 at 2 31 07 AM Screenshot 2024-06-06 at 2 31 42 AM

Expected Behavior

What behavior were you expecting to see?
No error when loading ng-scrollbar with cdk virtual scroll on the server using angular ssr

Actual Behavior

What behavior did you actually see?
An error in the server side console logs.

Environment

  • Angular: 18.0.1
  • ngx-scrollbar: 15.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS and Windows
@MurhafSousli
Copy link
Owner

MurhafSousli commented Jun 7, 2024

I just published a beta release 15.0.1-beta.0, could you try if this fixes the issue?

@MurhafSousli MurhafSousli linked a pull request Jun 7, 2024 that will close this issue
@kanehjeong
Copy link
Author

@MurhafSousli Tested 15.0.1-beta.0 and it works great 👍.

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

Successfully merging a pull request may close this issue.

2 participants