From 445cc62b3e64f8e8aacd402e86f95938ea4ae3e4 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Wed, 19 Jun 2024 18:20:30 +0800 Subject: [PATCH] docs: update code block filename in dynamic API context error page (#67000) The filenames of the two code blocks on this page https://nextjs.org/docs/messages/next-dynamic-api-wrong-context are written as comment instead of using the `filename` prop. ![image](https://github.com/vercel/next.js/assets/20135478/86b45742-cb83-4cd1-933c-a1c22f51e0fd) --------- Signed-off-by: Eng Zer Jun Co-authored-by: Sam Ko --- errors/next-dynamic-api-wrong-context.mdx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/errors/next-dynamic-api-wrong-context.mdx b/errors/next-dynamic-api-wrong-context.mdx index 064baba882..30bdee997e 100644 --- a/errors/next-dynamic-api-wrong-context.mdx +++ b/errors/next-dynamic-api-wrong-context.mdx @@ -14,19 +14,17 @@ Make sure that all Dynamic API calls happen in a request scope. Example: -```diff -// app/page.ts +```jsx filename="app/page.js" import { cookies } from 'next/headers' -- const cookieStore = cookies() +- const cookieStore = cookies() export default function Page() { + const cookieStore = cookies() return ... } ``` -```diff -// app/foo/route.ts +```jsx filename="app/foo/route.js" import { headers } from 'next/headers' - const headersList = headers()