Skip to content

Commit 970c5d2

Browse files
authoredAug 14, 2024··
fix(runtime): update call to prepend to remove null node (#5946)
1 parent 37a0aaf commit 970c5d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/runtime/styles.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ export const addStyle = (styleContainerNode: any, cmpMeta: d.ComponentRuntimeMet
105105
preconnectLinks.length > 0
106106
? preconnectLinks[preconnectLinks.length - 1].nextSibling
107107
: document.querySelector('style');
108-
styleContainerNode.insertBefore(styleElm, referenceNode);
108+
(styleContainerNode as HTMLElement).insertBefore(styleElm, referenceNode);
109109
} else if ('host' in styleContainerNode) {
110110
/**
111111
* if a scoped component is used within a shadow root, we want to insert the styles
112112
* at the beginning of the shadow root node
113113
*/
114-
styleContainerNode.prepend(styleElm, null);
114+
(styleContainerNode as HTMLElement).prepend(styleElm);
115115
}
116116
}
117117

0 commit comments

Comments
 (0)
Please sign in to comment.