polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

[scoped-custom-element-registry] No support for isomorphic scripts

Open jonathandewitt-dev opened this issue 11 months ago • 2 comments

Description

I'm attempting to render DSD for web components on the server side. It's difficult to support scoped elements, however, because the polyfill is not server-friendly.

The polyfill must be statically imported before my code; conditionally loading the polyfill does not work.

Example

Simply import the library and launch the script using Node.

// example.js
import '@webcomponents/scoped-custom-element-registry';
node example.js

Expected behavior

No error should be thrown. Script should be ignored on the server.

Actual behavior

ReferenceError: ShadowRoot is not defined

Version

0.0.9

jonathandewitt-dev avatar Dec 01 '24 17:12 jonathandewitt-dev