Skip to content

Commit 2eb48e7

Browse files
[Script] Updates stale no-script-in-document-page error doc (#37568)
[Recent changes](#31936) to `next/script` introduced the capability to use `beforeInteractive` scripts in the custom document. This old error message is incorrect.
1 parent 31c8b97 commit 2eb48e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

errors/no-script-in-document-page.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Script component inside \_document.js
22

3+
> ⚠️ This error is not relevant in versions 12.1.6 or later. Please refer to the updated [error message](https://nextjs.org/docs/messages/no-before-interactive-script-outside-document).
4+
35
#### Why This Error Occurred
46

5-
You can't use the `next/script` component inside the `_document.js` page. That's because the `_document.js` page only runs on the server and `next/script` has client-side functionality to ensure loading order.
7+
You can't use the `next/script` component inside the `_document.js` page in versions prior to v12.1.6. That's because the `_document.js` page only runs on the server and `next/script` has client-side functionality to ensure loading order.
68

79
#### Possible Ways to Fix It
810

0 commit comments

Comments
 (0)