Skip to content

Commit 72d5cb8

Browse files
Kocalsergeylarionov-upwork
authored andcommitted
fix($core): check if meta is from head before removing it (vuejs#2403)
1 parent 7bddd03 commit 72d5cb8

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

Lines changed: 3 additions & 3 deletions
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)