diff --git a/src/index.tsx b/src/index.tsx index d23cdd2..225f757 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -124,7 +124,7 @@ function initClientProvider() { if (element.parentNode != document.head) { document.head.appendChild(element); } - if (lastVisited && lastVisited.ref) { + if (lastVisited && lastVisited.ref && lastVisited.ref.parentNode) { document.head!.removeChild(lastVisited.ref); }