Skip to content
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

Element is not defined in deno #178

Closed
nnmrts opened this issue Feb 28, 2022 · 0 comments · Fixed by #183
Closed

Element is not defined in deno #178

nnmrts opened this issue Feb 28, 2022 · 0 comments · Fixed by #183

Comments

@nnmrts
Copy link

nnmrts commented Feb 28, 2022

When using this library within deno inside a React SSR environment, the check introduced in #152 is not enough.

In deno, window is defined and represents the usual globalThis (but document isn't for example), so this "browser check" doesn't work here. Fortunately in this case, the thing this check really should do is to check for window.Element and not just window.

My suggestion would be to replace this:

if (typeof window === 'undefined') {
    return;
}

with this:

if (typeof Element === 'undefined') {
    return;
}

and I will add a PR for that.

PatrickJS added a commit to PatrickJS/inert that referenced this issue May 23, 2022
@PatrickJS PatrickJS mentioned this issue May 23, 2022
robdodson pushed a commit that referenced this issue Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant