This occurs only when including preact.
Steps to reproduce:
The problem arose from the header-manager's method(updateTitle). Preact's VNode exposes just attributes to props with no children, the VNode itself exposes children.
I'll have a look 馃憤
Ok I get what you mean. We read component.props.children which is set in React, but not in preact. in preact it's component.children Looks like something that would have to be added to preact-compat. I'll check that now 馃憤
Looks like it's handled here already 馃 https://github.com/developit/preact-compat/blob/master/src/index.js#L109
@developit could you have a look? 鉂わ笍
@timneutkens I just checked and I'm not sure I can reproduce the above issue - here's the JSFiddle I set up: https://jsfiddle.net/developit/n144pt7m/
I might be going about the repro wrong though!
FWIW I'm not sure L45 of <HeadManager> accounts for the case where a single element is passed. In React (and thus in preact-compat), that will result in props.children being a reference to the Virtual DOM Element, rather than an Array.
That is to say, this line:
typeof children==='string' ? children : children.join('')
...if rendered like this:
<HeadManager><AnyThing /><HeadManager>
... will throw an exception, because children is an Object (VNode), not a String or Array.
It seems like this would be an issue when running under React as well, since preact-compat's behavior here is just mimicking React's. Adding an Array check before the join would at least circumvent any exception.
That is a fair point, we will have to update that. The most minimal example where I can reproduce this is this: https://github.com/timneutkens/next-issue-910. In this case, props.children is undefined. That's why it logs an error.
Ah perfect @timneutkens that gives me a great repro. It looks like the bit that adds props.children is only being applied to Component vnodes, not element VNodes. We can remedy that quickly :)
Much appreciated 鉂わ笍
Should be fixed in [email protected]
Thank you very much @developit 馃憤 馃挴
Thanks @developit
Just confirmed using your repro (thanks again btw!) that it is in fact working now:

@developit confirmed it too 鉂わ笍
Great, thanks a million for surfacing this Tim!
I am seeing this with:
I want to have a page title containing a bullet character (•). If I do:
<Head><title>foo • bar</title></Head>
... then the title appears as "foo • bar" because the • gets escaped to &bull;.
When I switch to:
<title dangerouslySetInnerHTML={{ __html: "foo • bar" }} />
... the title is set correctly, but this error starts appearing in the browser console, ostensibly because <title></title> has no children at all?
ping @timneutkens @rauchg
@atuttle I am running on the same issue with updating title tag. Did you find a fix or workaround please ? tanks in adavnce
I'm seeing this issue whenever I navigate on the client-side. If I do a refresh it doesn't occur and the title of the page is correct.
@donaminos no, no solution or workaround has been provided yet. It's possible that this is not a problem in a more recent version of Next, but I haven't had the chance to upgrade yet. I am just not using any HTML entities in my title, as annoying as that is.
Does this have any ramifications, or can it be treated as a warning for now? I am using dangerouslySetInnerHTML to unescape special characters in the page's server render, which I suppose isn't a huge deal if I were to stop using it. But I'd prefer to have nice clean titles for the Google.
Most helpful comment
Just confirmed using your repro (thanks again btw!) that it is in fact working now:
