Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

DanMB/svelte-head-replacement-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTE: This was fixed in the 5.0.0-next.96 pre-release

Live reproduction

https://svelte-head-replacement-bug.vercel.app/ Open the dev tools inspection, and observe the meta tags shift around when navigating to the subpage, and then back to the home page.

Bug description

When defining a svelte:head segment in both the layout and page files, and navigating to a different page, the layout head segment is removed and replaced by the initially loaded page head segment. This results in important site-wide head elements being removed, and will result in duplicated head elements when navigating back to the same page that was initially loaded. It seems Svelte is keeping the incorrect head segment of the two for some reason.