-
Notifications
You must be signed in to change notification settings - Fork 28.5k
title issue with react-18 #35870
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
Comments
Probably related facebook/react#24263 |
Can you try to encode the whole title with jsx? As above issue mentioned, comments are injected intentionally as new constraints for streaming rendering, so if you want to keep it as a single string maybe wrap them together as a jsx child to avoid generating comments <title>
{(typeof location !== "undefined" ? location.pathname : "") + " | abc"}
</title> |
I hope this isn't unnecessary noise but I can confirm this bug. I am experiencing it as well. |
(Upvoting the original issue is usually enough unless more context/info/reproduction is provided in a comment) Were you able to try out the suggestion from #35870 (comment)? |
There wasn't a strong reason to choose `renderToStream` over `renderToStaticMarkup` for the document wrapper. But due to problems like #35870, we can switch back to the static renderer for now. Fixes #35870. ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` Co-authored-by: JJ Kasper <[email protected]>
Upgrades Next.js to version that fixes HTML comment showing up in the browser tab title. See: - vercel/next.js#35870 - vercel/next.js#36213 - facebook/react#24263
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #23-Ubuntu SMP Fri Mar 11 14:54:05 UTC 2022
Binaries:
Node: 17.8.0
npm: 8.5.5
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.5-canary.0
react: 18.0.0
react-dom: 18.0.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
With React 18, there is a html comment inside the title tag:
NextJS + React 17:
NextJS + React 18:
Expected Behavior
no html comment is inside the title tag
To Reproduce
https://github.com/SimonSiefke/nextjs-title-issue
The text was updated successfully, but these errors were encountered: