descope / angular-sdk

Angular library used to integrate with Descope (Deprecated)
https://github.com/descope/descope-js/tree/main/packages/sdks/angular-sdk
MIT License
25 stars 1 forks source link

Angular 17.2.0 SSR issue #139

Open iHusak5bsoftware opened 4 months ago

iHusak5bsoftware commented 4 months ago

[error] ReferenceError: document is not defined .angular/prerender-root/node_modules/@descope/web-component/dist/esm/index-4f8f54da.js

How to fix?

asafshen commented 4 months ago

hey @iHusak5bsoftware , can you share more information about the issue? what is the setup that it happens?

the angular-sdk, (specifically the components) uses the document

you should try yo lazy load angular sdk, using something like the following: https://medium.com/front-end-weekly/advanced-lazy-loading-techniques-in-angular-3492a1af2470

iHusak5bsoftware commented 4 months ago

@asafshen Hi, just use {DescopeAuthModule, DescopeAuthService, descopeInterceptor} but when start SSR in dev mode it show that in web-component "document is not defined"

asafshen commented 4 months ago

@iHusak5bsoftware I'm not too familiar with Angular SSR, can you layout the details so I could attempt to reproduce?