This is a feature request
Currently nebular does not support server side rendering
I followed this guideline:
https://github.com/angular/angular-cli/wiki/stories-universal-rendering
At the end I found out that nebular uses things which are not supported while rendering on the server side.
e.g. window, document, localstorage etc
Kindly fix this issue.
You might want to look into a work around discussed here - https://github.com/angular/universal/issues/830.
I have Nebular UI running in SSR setup with domino. There are other minor issues associate with it, but nothing that stops the application from running. See my server.ts here - https://github.com/akveo/nebular/issues/402 . Hope it helps.
I just successfully ran my application using domino
Thanks a bunch !
"So how did you use domino to resolve this? I'm just not getting this to work after upgrading to rc.10. It's specifically complaining about the theme module."
Hi @tdespenza, you can open a new issue with the details of the issues you are having.
"@nnixaa I got it figured out.
I just used jsdom-global instead of domino."
Any fix available? the problem is still present with ssr.
I found a solution for this. It is working for me, the nebular components just needs some modifications so it executes window.localStorage.getItem() only only if platform is browser.
Anyways here are the instructions.
Note: After been trying to get his working for several hours. I learned that Angular Docs is missing several things for SSR thats why i chose to move source to Angular Universal Starter instead.
There is also problem running in SSR because of window is not defined in intersection observer module
Most helpful comment
There is also problem running in SSR because of window is not defined in intersection observer module