components
components copied to clipboard
bug(cdk-virtual-scroll-viewport): Content not present in SSR load
Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When rendering a page in SSR mode, the content for the virtual scroll is not rendered. It's blank. The page works fine when rendered in the browser. Screenshot attached for the SSR load response
:
Reproduction
Steps to reproduce:
- Clone the repo https://github.com/bivs06/angular-universal-ssr-bug
- Run
npm run dev:ssr
- Check the response in the network tab
StackBlitz link: https://stackblitz.com/edit/angular-ivy-kfyv87?file=src%2Fapp%2Fapp.component.html
Expected Behavior
The items for virtual scroll should load in SSR load
Actual Behavior
The items for the virtual scroll are not loading in the SSR load
Environment
- Angular:
- CDK/scrolling:
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Hi all, news for this bug?
I'm having the same issue.
Is it even possible to get *cdkVirtualFor
to render something in SSR? Shouldn't it at least be possible to prerender an item list which has a fixed item size on every viewport width?
Any update on this issue?
Any update on this issue?
Please provide some updates or any help with any workaround or alternative is highly appreciated. Thanks!!!
As per the code CDK virtual scroll will not support SSR, did I miss spotting this anywhere on the docs page? If not why it is not explicitly mentioned anywhere?
Same error in my case when i need add Virtual CDK Scroll throw error with SSR and in doc not mention only working in browser