Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

ripple: HTMLElement is not defined on SSR #581

@4cm4k1

Description

@4cm4k1

Hello,

With the changeover to TS in v0.8.0, the following line went from being scoped within a function to not:

const MATCHES = util.getMatchesProperty(HTMLElement.prototype);

In SSR React apps, this will result in an HTMLElement is not defined error, because it's not evaluated in a browser where HTMLElement would exist.

The following line, when added just before the line above, resolves the issue locally:

const HTMLElement = typeof HTMLElement === 'undefined' ? function () {} : HTMLElement;

However, I'm not sure this is an appropriate solution outside of my use case. If this addition would suffice, I can submit a PR for it. Let me know! Thanks! 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions