Skip to content
This repository was archived by the owner on Oct 27, 2022. It is now read-only.
This repository was archived by the owner on Oct 27, 2022. It is now read-only.

ReferenceError: window is not defined when using server-side rendering #14

Closed
@mloncaric

Description

@mloncaric

!('getComputedStyle' in window) && (window.getComputedStyle = (function (window) {

The following check should be enough i think
typeof window != "undefined"

Smth like:
typeof window != "undefined" && !('getComputedStyle' in window) && (window.getComputedStyle = (function (window) {
instead of
!('getComputedStyle' in window) && (window.getComputedStyle = (function (window) {

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