-
Notifications
You must be signed in to change notification settings - Fork 5
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
Prerender Error - document is not defined #22
Comments
Thank you for pointing it out! If you could share a reproduction in online editor or your own repo it would be much appreciated! |
I have been looking into it, without prior knowledge of Angular Universal, does shimming with domino (as explained here) can help solving this? |
I wrote my custom dark-mode.service and that is example of my source code:
It works great for prerender mode on the Angular Universal. You can use @Inject(DOCUMENT) for works with document, but for Local Storage you can don't use it on the server side. |
Guarded and abstracted DOM access BREAKING CHANGE: Must include DarkModeModule for proper injection of default options fix #22
Guarded and abstracted DOM access BREAKING CHANGE: Must include DarkModeModule for proper injection of default options fix #22
Hi, I've tried the plugin it's now working with Angular Universal, can you please advise on what to do for it to work with Angular Universal. |
Hi, @Takudzwamz could you please provide a reproduction? possibly with @yalesnikov advice. |
Hi @talohana I followed what @yalesnikov suggested and I got it to work, thank you so much guys. |
Hello, angular-dark-mode crashed building with prerender mode.
It's document is not defined error.
It'll be good to add condition to check is server or browser platform and run scripts only in the browser.
The text was updated successfully, but these errors were encountered: