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.

ReferenceError: Element is not defined on SSR #561

@lucasecdb

Description

@lucasecdb

Hello, I'm getting a ReferenceError: Element is not defined when I try to SSR the Drawer component, running on version 0.7.1.

The issue is probably some optimization on the webpack build process where it removes "dead-code", because the error occurs on the tabbable npm package, imported from focus-trap, specifically on this line. But, as you can see, it has a check specifically to avoid this issue when running on node environments. I have checked the minified code and have confirmed that the check for the typeof Element is optimized away.

Unfortunately I don't have a reproducible codesandbox snippet as it doesn't execute the code with SSR 😔

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