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

Angular 17 or higher with Server Side Rendering #3273

Open
1 of 2 tasks
balu192 opened this issue Nov 22, 2024 · 0 comments
Open
1 of 2 tasks

Angular 17 or higher with Server Side Rendering #3273

balu192 opened this issue Nov 22, 2024 · 0 comments

Comments

@balu192
Copy link

balu192 commented Nov 22, 2024

Issue type

I'm submitting a ...** (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior & Steps to reproduce:
I use the Nebular Auth modules in version 13.
I tried to use the Nebular Auth Modules with a basic angular 17 application and I activated server side rendering for Angular 17,
because Nebular is compatible with server side rendering.

After updating to SSR, I tried to use ng run sampleapp:prerender

I get following error:
ERROR ReferenceError: localStorage is not defined
at NbTokenLocalStorage2.get (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1668:351555)
at NbTokenService2.publishStoredToken (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1668:352798)
at new NbTokenService2 (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1668:352232)
at NbTokenService.ɵfac [as factory] (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1668:352846)
at R3Injector.hydrate (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1618:29688)
at R3Injector.get (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1618:26934)
at injectInjectorOnly (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1618:6459)
at Object.ɵɵinject (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1618:6629)
at NbAuthService.ɵfac [as factory] (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1668:355586)
at R3Injector.hydrate (D:\SERVER\sampleapp\dist\sampleapp\server\vendor.js:1618:29688)

Some Nebular Classes and services uses the localStorage, but I didn't find a solution, sample or documentation at the wohole web for using Nebular with Standard SSR with a basic project of Angular 17or higher.

Expected behavior:
The Nebular modules works directly with server side rendering or there is some documentation for using angular with ssr,because this will be the standard for all implmentations in the future versions of Angular.
Please add some sample project and documentaton for the Angular SSR topic.

Other information:

npm, node, OS, Browser


Node v20.11.1
OS: Windows (10)
Browser: Chrome/Safari/Firefox

Angular, Nebular
"dependencies": {
"@angular/animations": "^17.3.0",
"@angular/cdk": "17.3.0",
"@angular/common": "^17.3.0",
"@angular/compiler": "^17.3.0",
"@angular/core": "^17.3.0",
"@angular/forms": "^17.3.0",
"@angular/platform-browser": "^17.3.0",
"@angular/platform-browser-dynamic": "^17.3.0",
"@angular/platform-server": "^17.3.0",
"@angular/router": "^17.3.0",
"@angular/ssr": "^17.3.11",
"@nebular/auth": "^13.0.0",
"@nebular/eva-icons": "^13.0.0",
"@nebular/security": "^13.0.0",
"@nebular/theme": "^13.0.0",

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

1 participant