-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Angular integration] [ReferenceError: document is not defined] #2320
Comments
Hi @MohamedAsaad1, consider importing |
Thanks for your reply but I got the same error [vite] Internal server error: document is not defined import { Component, OnInit } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { Tooltip, initTWE } from 'tw-elements';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.scss'
})
export class AppComponent implements OnInit {
title = 'test-app';
ngOnInit() {
initTWE({ Tooltip }});
}
} |
Try using the |
Describe the bug
When attempting to use server-side rendering (SSR) with Angular and Vite, an error occurs during the evaluation of the server-side rendering module (
main.server.mjs
). The error is aReferenceError
, stating thatdocument is not defined
.Expected behavior
The application should render without errors during server-side rendering.
Actual behavior
A
ReferenceError
occurs during the evaluation of the server-side rendering module, specifically related to thedocument
object not being defined.Show your code
Desktop
The text was updated successfully, but these errors were encountered: