Skip to content

Commit 3c94f71

Browse files
authored
fix($core): check if meta is from head before removing it (#2403)
1 parent e790ad3 commit 3c94f71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/@vuepress/core/lib/client/root-mixins/updateMeta.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ export default {
6161
*/
6262
function updateMetaTags (newMetaTags, currentMetaTags) {
6363
if (currentMetaTags) {
64-
[...currentMetaTags].forEach(c => {
65-
document.head.removeChild(c)
66-
})
64+
[...currentMetaTags]
65+
.filter(c => c.parentNode === document.head)
66+
.forEach(c => document.head.removeChild(c))
6767
}
6868
if (newMetaTags) {
6969
return newMetaTags.map(m => {

0 commit comments

Comments
 (0)