diff --git a/src/sandbox/patchers/dynamicAppend/common.ts b/src/sandbox/patchers/dynamicAppend/common.ts index 8879a56ed..5806133e1 100644 --- a/src/sandbox/patchers/dynamicAppend/common.ts +++ b/src/sandbox/patchers/dynamicAppend/common.ts @@ -245,7 +245,9 @@ function getOverwrittenAppendChildOrInsertBefore(opts: { return rawDOMAppendOrInsertBefore.call(this, element, refChild) as T; } - const mountDOM = appWrapperGetter(); + const appWrapper = appWrapperGetter(); + const mountDOM = target === 'head' ? getAppWrapperHeadElement(appWrapper) : appWrapper; + const { fetch } = frameworkConfiguration; const referenceNode = mountDOM.contains(refChild) ? refChild : null;