Skip to content

Commit 18b8ccd

Browse files
committed
Check parentNode before trying to create cq instance
1 parent 8eb2d82 commit 18b8ccd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/engine.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ export function initializePolyfill() {
184184
instance?.disconnect();
185185
}
186186

187+
if (
188+
entry.target.nodeType !== Node.DOCUMENT_NODE &&
189+
entry.target.nodeType !== Node.DOCUMENT_FRAGMENT_NODE &&
190+
entry.target.parentNode === null
191+
) {
192+
continue;
193+
}
187194
if (
188195
entry.type === 'attributes' &&
189196
entry.attributeName &&

0 commit comments

Comments
 (0)