Skip to content

Reference Error: window is not defined Angular 14 #99

@nikxco

Description

@nikxco
ERROR Error: Uncaught (in promise): ReferenceError: window is not defined
ReferenceError: window is not defined

Getting ReferenceError for window with ssr build.

"@angular/animations": "^14.2.0",
"@angular/cdk": "^14.2.4",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/forms": "^14.2.0",
"@angular/material": "^14.2.4",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/platform-server": "^14.2.0",
"@angular/router": "^14.2.0",
"@nguniversal/express-engine": "^14.2.0"
"masonry-layout": "^4.2.2",
"ngx-masonry": "^14.0.1"
import { NgxMasonryModule } from 'ngx-masonry';

@NgModule({
  declarations: [HomeComponent],
  imports: [
    NgxMasonryModule,
    CommonModule,
    AppRoutingModule,
    MatButtonModule,
    MatIconModule,
    MatCardModule,
  ],
})
export class AppModule {}

Is it not compatible with SSR? or am i missing something

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions