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

Head-manager: Add support of next-head-count query selector in the whole document #21020

Closed
ermolaevalexey opened this issue Jan 12, 2021 · 2 comments

Comments

@ermolaevalexey
Copy link

Describe the feature you'd like to request

For now, by default, when rendering the app head, next searches for meta[name=next-head-count] in the document's root head. https://github.com/vercel/next.js/blob/master/packages/next/client/head-manager.ts#L37

But if the application is running as a part of common layout, this meta tag is found in body,
like here, #8220 (comment)
so we getting an error
head-manager.ts:49 Uncaught (in promise) TypeError: Cannot read property 'content' of null, so description and other meta tags cannot be set on client side.

Describe the solution you'd like

it would be nice to change the query selector to
const headCountEl = document.querySelector('meta[name=next-head-count]');, so it can be searched in the whole document.

Describe alternatives you've considered

For now this is the only solution I see

@timneutkens
Copy link
Member

Running Next.js inside of another page is not supported.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants