The next/script
component shouldn't be placed inside the next/head
component
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" />
</>
)
}