Fix/node custom elements (#5235)
* adapter-node fix CustomElementRegistry * Add changeset * Add fallback CustomElementRegistry
This commit is contained in:
parent
5be3fdec27
commit
b6a478f376
2 changed files with 8 additions and 2 deletions
5
.changeset/silly-mirrors-give.md
Normal file
5
.changeset/silly-mirrors-give.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/webapi': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix CustomElementRegistry for Node SSR Adapter
|
|
@ -81,8 +81,9 @@ export const initCustomElementRegistry = (
|
||||||
const CustomElementRegistry =
|
const CustomElementRegistry =
|
||||||
target.CustomElementRegistry || globalThis.CustomElementRegistry
|
target.CustomElementRegistry || globalThis.CustomElementRegistry
|
||||||
|
|
||||||
const customElements: CustomElementRegistry = (target.customElements =
|
const customElements: CustomElementRegistry =
|
||||||
Object.create(CustomElementRegistry.prototype))
|
target.customElements ||
|
||||||
|
(target.customElements = new CustomElementRegistry())
|
||||||
|
|
||||||
_.INTERNALS.set(customElements, {
|
_.INTERNALS.set(customElements, {
|
||||||
constructorByName: new Map(),
|
constructorByName: new Map(),
|
||||||
|
|
Loading…
Reference in a new issue