angular-sdk icon indicating copy to clipboard operation
angular-sdk copied to clipboard

Angular 17.2.0 SSR issue

Open iHusak5bsoftware opened this issue 1 year ago • 3 comments

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

How to fix?

iHusak5bsoftware avatar Jul 15 '24 01:07 iHusak5bsoftware

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

asafshen avatar Jul 15 '24 04:07 asafshen

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

iHusak5bsoftware avatar Jul 15 '24 09:07 iHusak5bsoftware

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

asafshen avatar Jul 15 '24 10:07 asafshen