silverwolf-x/project / errors /no-head-element.mdx
silverwolf-x's picture
download
raw
707 Bytes
---
title: No Head Element
---
> Prevent usage of `<head>` element.
## Why This Error Occurred
A `<head>` element was used to include page-level metadata, but this can cause unexpected behavior in a Next.js application. Use Next.js' built-in `next/head` component instead.
## Possible Ways to Fix It
Import and use the `<Head />` component:
```jsx filename="pages/index.js"
import Head from 'next/head'
function Index() {
return (
<>
<Head>
<title>My page title</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
</>
)
}
export default Index
```
## Useful Links
- [next/head](/docs/pages/api-reference/components/head)

Xet Storage Details

Size:
707 Bytes
·
Xet hash:
5c395f0d92a4a39c876f05b98a06beb77e08d8c843cdb783f12670e6d3c989b2

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.