/
githubmirror
/
next.js
Обзор
Документация
Войти
/
githubmirror
/
next.js
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
canary
errors/inline-script-id.mdx
30 строк
687 B
Delba de Oliveira
docs: Move optimizing pages to guides (#78500)
24 апр 2025, 21:40
Не верифицирован
24 апр 2025, 21:40
76ade73
Код
Авторство
О чём код?
--- title: Inline script id --- > Enforce `id` attribute on `next/script` components with inline content. ## Why This Error Occurred `next/script` components with inline content require an `id` attribute to be defined to track and optimize the script. ## Possible Ways to Fix It Add an `id` attribute to the `next/script` component. ```jsx filename="pages/_app.js" import Script from 'next/script' export default function App({ Component, pageProps }) { return ( <> <Script id="my-script">{`console.log('Hello world!');`}</Script> <Component {...pageProps} /> </> ) } ``` ## Useful links - [Docs for Next.js Script component](/docs/pages/guides/scripts)