Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydration removes <title> element #4310

Closed
Conduitry opened this issue Jan 23, 2020 · 1 comment · Fixed by #4311
Closed

Hydration removes <title> element #4310

Conduitry opened this issue Jan 23, 2020 · 1 comment · Fixed by #4311
Labels

Comments

@Conduitry
Copy link
Member

Describe the bug
When starting from SSR generated HTML with hydratable: true, hydration will remove the <title> element along with the other appropriate <head> elements, but will not add it back.

Logs
None.

To Reproduce
https://github.com/johnmuhl/svelte-hydrate-head

Expected behavior
The <title> should remain after hydration.

Stacktraces
None.

Information about your Svelte project:
Independent of browser.
Svelte 3.17.0+

Severity
Pretty bad.

Additional context
This was introduced in #4082. The compiled component sets document.title first and then later removes elements matching [data-svelte="svelte-..."], and so the title is lost. The simplest way to handle this would probably be to not add the special SSR attribute to the <title> element at all, since as of #4250 we don't need to worry about there being more than one of that anyway.

cc @johnmuhl @tanhauhau

@Conduitry
Copy link
Member Author

Fixed in 3.17.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant