From c0052b8a0a3606466bc4b72061474002ed84941a Mon Sep 17 00:00:00 2001 From: Chris Drifte <74468367+chrisdrifte@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:40:48 +0100 Subject: [PATCH] docs: Add --inspect=0.0.0.0 to server-side debugging (#72069) ### What? Explicitly mentions `--inspect=0.0.0.0` and its use case. ### Why? NextJS apps are commonly run inside docker containers when self-hosting. In this case, the example in the docs will not work as expected, blocking users who are not familiar with the --inspect flag. ### How? Added a "Good to Know" content block. Co-authored-by: JJ Kasper --- .../07-configuring/16-debugging.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/02-app/01-building-your-application/07-configuring/16-debugging.mdx b/docs/02-app/01-building-your-application/07-configuring/16-debugging.mdx index 79b89b460d6a3..a637b8c97be85 100644 --- a/docs/02-app/01-building-your-application/07-configuring/16-debugging.mdx +++ b/docs/02-app/01-building-your-application/07-configuring/16-debugging.mdx @@ -76,6 +76,8 @@ To debug server-side Next.js code with Chrome DevTools, you need to pass the [`- NODE_OPTIONS='--inspect' next dev ``` +> **Good to know**: Use `NODE_OPTIONS='--inspect=0.0.0.0'` to allow remote debugging access outside localhost, such as when running the app in a Docker container. + If you're using `npm run dev` or `yarn dev` then you should update the `dev` script on your `package.json`: ```json filename="package.json"