From bfd3b5528d465b6380bf29c55a5ffaa4e7c52d2c Mon Sep 17 00:00:00 2001 From: Zack Sheppard Date: Sun, 1 Aug 2021 15:26:33 +0100 Subject: [PATCH] Clarify in docs that `next/script` must not be in `next/head` (#27534) Documentation to help future developers avoid #27498 ## Documentation / Examples - [X] Make sure the linting passes --- docs/basic-features/script.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/basic-features/script.md b/docs/basic-features/script.md index 37da887186c9c..1d4a0b302e13a 100644 --- a/docs/basic-features/script.md +++ b/docs/basic-features/script.md @@ -49,7 +49,11 @@ export default function Home() { } ``` -With `next/script`, you no longer need to wrap scripts in `next/head`. Further, `next/script` should **not** be used in `pages/_document.js` as `next/script` has client-side functionality to ensure loading order. For example: +Now, you use `next/script` in the body of your Next.js page. It has client-side functionality that decides when and how to load the remote script based on the `strategy`. + +> **Note:** +> +> - `next/script` **must not** be placed in either a `next/head` component or in `pages/_document.js`. ```js // After