diff --git a/src/runtime/styles.ts b/src/runtime/styles.ts index cedf3559d0a..9bca568854d 100644 --- a/src/runtime/styles.ts +++ b/src/runtime/styles.ts @@ -104,7 +104,7 @@ export const addStyle = (styleContainerNode: any, cmpMeta: d.ComponentRuntimeMet const referenceNode = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling - : document.querySelector('style'); + : styleContainerNode.querySelector('style'); (styleContainerNode as HTMLElement).insertBefore(styleElm, referenceNode); } else if ('host' in styleContainerNode) { /**