a28e775e88
## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. [Feature Request](https://github.com/vercel/next.js/discussions/26365) - [x] Eslint unit ests added - [x] Errors have helpful link attached, see `contributing.md` Let me know if this looks good or something needs to be changed. I still need to add the error links and improve the eslint error messages. I don't know if the CI runs the ESLint tests, but current all pass locally
869 B
869 B
Script component inside Head component
Why This Error Occurred
The next/script
component shouldn't be placed inside the next/head
component
Possible Ways to Fix It
Move the <Script />
component outside of <Head>...</Head>
Before
import Script from 'next/script'
import Head from 'next/head'
export default function Index() {
return (
<Head>
<title>Next.js</title>
<Script src="/my-script.js" />
</Head>
)
}
After
import Script from 'next/script'
import Head from 'next/head'
export default function Index() {
return (
<>
<Head>
<title>Next.js</title>
</Head>
<Script src="/my-script.js" />
</>
)
}