Skip to content

Commit

Permalink
fix: gracefully handle disappearing head elements
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Mar 4, 2024
1 parent 686800f commit 7b40442
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/dom/src/renderDOMHead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export async function renderDOMHead<T extends Unhead<any>>(head: T, options: Ren
tag[k] && tag[k] !== $el[k] && ($el[k] = tag[k])
})
track(id, 'el', () => {
state.elMap[id].remove()
// the element may have been removed by a duplicate tag or something out of our control
state.elMap[id]?.remove()
delete state.elMap[id]
})
}
Expand Down

0 comments on commit 7b40442

Please sign in to comment.