Skip to content

ReferenceError: window is not defined. This library does not work with SSR/SSG/Node env #389

Description

@TSMMark

It would be great if this library did not require window to exist. Otherwise this can't be used with a next.js app or be imported during SSG.

What would it take to check typeof window !== 'undefined' or something before referencing the window object? Or at least not reference window when the library is imported, and instead wait until some raygun function is invoked (lazy)?

Or is there another solution?

Thanks


Related: #301

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions