diff --git a/.changeset/silly-mirrors-give.md b/.changeset/silly-mirrors-give.md new file mode 100644 index 0000000000..baa94162f9 --- /dev/null +++ b/.changeset/silly-mirrors-give.md @@ -0,0 +1,5 @@ +--- +'@astrojs/webapi': patch +--- + +Fix CustomElementRegistry for Node SSR Adapter diff --git a/packages/webapi/src/lib/CustomElementRegistry.ts b/packages/webapi/src/lib/CustomElementRegistry.ts index 3429e1e730..21f775d5e5 100644 --- a/packages/webapi/src/lib/CustomElementRegistry.ts +++ b/packages/webapi/src/lib/CustomElementRegistry.ts @@ -81,8 +81,9 @@ export const initCustomElementRegistry = ( const CustomElementRegistry = target.CustomElementRegistry || globalThis.CustomElementRegistry - const customElements: CustomElementRegistry = (target.customElements = - Object.create(CustomElementRegistry.prototype)) + const customElements: CustomElementRegistry = + target.customElements || + (target.customElements = new CustomElementRegistry()) _.INTERNALS.set(customElements, { constructorByName: new Map(),