We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When using flowbite in Angular with SSR, we have the following error in the terminal:
ERROR ReferenceError: document is not defined
To Reproduce Steps to reproduce the behavior:
ng serve
http://localhost:4200/
Expected behavior In Angular without ssr, after following these processes no error is returned in the terminal, that's what we expect.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
Is this really the concern of Flowbite? Initialization of the JavaScript related to DOM might only happen in client.
import { Component, PLATFORM_ID, Inject } from '@angular/core'; import { initFlowbite } from "flowbite"; import { isPlatformBrowser } from "@angular/common"; @Component({ selector: 'app-root', standalone: true, template: `<div></div>`, }) export class AppComponent { title = 'frontend-comments'; constructor(@Inject(PLATFORM_ID) private platformId: Object) {} ngOnInit(): void { if (isPlatformBrowser(this.platformId)) { initFlowbite(); } } }
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When using flowbite in Angular with SSR, we have the following error in the terminal:
ERROR ReferenceError: document is not defined
To Reproduce
Steps to reproduce the behavior:
ng serve
in the terminal, access the url:http://localhost:4200/
and click the f5 key or interact with the flowbite components.Expected behavior
In Angular without ssr, after following these processes no error is returned in the terminal, that's what we expect.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: