Failed to execute 'createElement' on 'Document' | v9.5.4
See original GitHub issueBug report
Describe the bug
I ran into this error after updating Next.js to version 9.5.4. The problem is that you cannot use React Components inside Head
in _app.js file.
Minimal Example:
const Metadata = () => (
<>
<base href="/" />
<meta name="msapplication-TileColor" content="#000000" />
{/*...*/}
</>
)
class NextApp extends App {
render() {
return (
<>
<Head>
<title>Next Bug Report</title>
{/*Error*/}
<Metadata />
</Head>
</>
)
}
}
To Reproduce
Just open the dev server
Reproduction repo: next-bug-report
Screenshots
System information
- Version of Next.js: [9.5.4]
- Version of React/ReactDOM: [16.13.1]
- Version of Node.js: [14.0.0]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:56
- Comments:28 (17 by maintainers)
Top Results From Across the Web
Failed to execute 'createElement' on 'Document': The tag ...
In my case, I was building my web app and I had created a javaScript file in the IDE IntelliJ. But in the...
Read more >Failed To Execute 'Createelement' On 'Document': The Tag ...
Failed to execute 'createElement' on 'Document': The tag name provided is not a valid name #197. I'm trying to have reactsvgloader 2.1.0 to...
Read more >Release Notes - Documentation ・ CoreMedia
Now, a concluding failure message is written to stdout. ... To enable the IPreviewUrlTransformer execution for the external ... createElement('script');.
Read more >next js sass variables - You.com | The search engine you control.
On Next.js v9.5.4 and later, you should use additionalData . Open side panel ... Unable to override Vuetify 2.1 SASS variables.
Read more >Failed to execute 'createElement' on 'Document' error message
[This thread is closed.] Hello, while logged into my website, hovering over the “G Site Kit” link in the black WordPress admin bar...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also having this issue when trying pass a component into the
<Head>
@jflayhart in our case we just called a function that returns an array of
links
toprefetch
,preconnect
. so:instead of:
That fixed our problem on dev build and removed the error on console in production. Maybe that could help, in some cases.