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
next/head unsetting _document <title> #3527
Comments
Same issue, running |
I had this problem with 4.3.0-canary.1 It has been corrected as of 4.4.0-canary.3 |
This is indeed a bug. This line show be wrapped in the if statement. I'll fix it once I'm done with universal webpack |
@timneutkens I can make PR for this if you don't mind. |
@Sekhmet sure 👍 Please add tests for it 👍 |
I've just come across this and it's still present in next@5.0.1-canary.16. Example here: https://next-title-bug-kraxvxvjas.now.sh - source |
This is quite critical and still present. Any news? |
Same here, title and description appears in first glance but instantly goes away. |
still an issue in 0.5.1, when will the fix be merged? |
Chiming in to say this appears to still be an issue. React is logging the correct value for <title> on render, but it appears blank after that. |
what seems to have worked for me was to add another Head with just the title in my component. weird seeing everything else from _document.js is there |
Having this issue in 5.01-canary.17. For now I will just duplicate the head on the pages that I need. Please fix one day :) |
JonathonJulian's solution seems pretty hacky. And while adding another title tag does leave the 2nd title tag intact, the first one is still getting emptied. In Chrome at least, the first one is what gets checked. Is there a timetable on this being fixed for real? EDIT: It does actually work ok if it's placed inside a head tag on the page level (e.g. index.js) but not if it's placed in _document.js or any other component. Does this error stem from letting individual pages overwrite the _document.js title? |
Agreed, its not really a solution, a workaround at best, I ended up removing the title in _document as both tags were being picked up by google web crawlers My site is pretty basic so not a big deal for me to to add to the pages and its better than no title, but still… pls fix, surprised this was fixed in 6.0?? |
See my comments here: #3795 |
I'm trying to add a custom Social component to my site that adds several relevant meta tags, but it's setting the
<title>
to an empty string. I have the title defined in_document.js
and don't change it anywhere else in the codebase. I'm running the Canary version of Next.jsThe custom component I call looks like this:
It adds all the meta tags correctly (not sure if it's related, but I needed to add the
key
parameter - otherwise only the second set of meta tags was added) and the other meta tags from_document.js
remain intact, but somehow the title tag just becomes<title></title>
.I've created a small example here - https://next-title-pnxpfydvvh.now.sh
The text was updated successfully, but these errors were encountered: