Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Angular 17.2.0 SSR issue #139

Open
iHusak5bsoftware opened this issue Jul 15, 2024 · 3 comments
Open

Angular 17.2.0 SSR issue #139

iHusak5bsoftware opened this issue Jul 15, 2024 · 3 comments

Comments

@iHusak5bsoftware
Copy link

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

How to fix?

@asafshen
Copy link
Member

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
Copy link
Author

@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
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants