Skip to content

[labs/ssr-react] guard against enable-lit-ssr.js wrapping createElement multiple times #4986

@augustjk

Description

@augustjk

Should this be an RFC?

  • This is not a substantial change

Which package is this a feature request for?

Other/unknown (please mention in description)

Description

in server frameworks like next.js, it may be possible that enable-lit-ssr.js might run multiple times in the server, leading to createElement being wrapped multiple times.

part of the observation described #4527 (comment) and from the stackblitz example shared there, refreshing the page causes error because multiple <template shadowrootmode="open"> elements are added to a single custom element.

we're already setting a global flag from this so we could guard the patching of createElement behind that flag too.

Alternatives and Workarounds

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions