-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"NODE_OPTIONS='--inspect' next dev" won't work correctly, debugging server-side not possiable #47561
Comments
Hi @Dkogan90 I've managed to get this to work, but it was really weird. To me it stood out: warn - the --inspect option was detected, the Next.js server should be inspected at port 9230. In spite of the line that points to 9229: Debugger listening on ws://127.0.0.1:9229/9a701303-c48a-4785-9ee0-8bea5a0e4cff So in the And then I was able to debug: It also works with And it also works with middleware: To me the weird thing is that it'd bump from 9229 to 9230, and I wonder if it is related to this from the docs:
Even if we do as they instruct, that seems to happen, could it be that there's some binary under the hood, that triggers this issue anyway? |
Duplicate of #47083 |
I was successful debugging in VS Code using the following launch configuration:
|
Which version of Next.js are you using? |
13.4.2
I am only using the new app dir and breakpoints work fine in various places
of my server-side code, e.g. Route handlers.
wt., 16 maj 2023, 11:02 użytkownik Cowboy Ho ***@***.***>
napisał:
… I was successful debugging in VS Code using the following launch
configuration:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/node_modules/next/dist/bin/next",
"runtimeArgs": [
"--inspect"
]
}
]
}
Which version of Next.js are you using?
Will it break when you added breakpoint into API or Page routes?
—
Reply to this email directly, view it on GitHub
<#47561 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJY44MTPFMCFANHL7WDBADXGM7B7ANCNFSM6AAAAAAWJCPOJ4>
.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
## Bug This fix closes #47083 issue This fix closes #47561 issue This fix closes #48376 issue **Invalid repetition PRs:** #47671 (this PR changing expired code) (This issue still exist on [v13.4.3-canary.1](https://github.com/vercel/next.js/releases/tag/v13.4.3-canary.1) - [x] Related issues linked using `fixes #number` ### What? When running `NODE_OPTIONS='--inspect' next dev`, the render server didn't start with `--inspect`. In some cases, the `--inspect` flag will be passed when `__NEXT_DISABLE_MEMORY_WATCHER` was set. ### Why? Since #47208 revamped some startup processes, the `NODE_OPTIONS` environment parameter is not passed down to the render server worker. ### How? Just add back the original startup process. ![image](https://user-images.githubusercontent.com/14261588/230398898-791e6909-6f4c-493b-937d-058a7b788849.png) link NEXT-1176 --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
## Bug This fix closes vercel#47083 issue This fix closes vercel#47561 issue This fix closes vercel#48376 issue **Invalid repetition PRs:** vercel#47671 (this PR changing expired code) (This issue still exist on [v13.4.3-canary.1](https://github.com/vercel/next.js/releases/tag/v13.4.3-canary.1) - [x] Related issues linked using `fixes #number` ### What? When running `NODE_OPTIONS='--inspect' next dev`, the render server didn't start with `--inspect`. In some cases, the `--inspect` flag will be passed when `__NEXT_DISABLE_MEMORY_WATCHER` was set. ### Why? Since vercel#47208 revamped some startup processes, the `NODE_OPTIONS` environment parameter is not passed down to the render server worker. ### How? Just add back the original startup process. ![image](https://user-images.githubusercontent.com/14261588/230398898-791e6909-6f4c-493b-937d-058a7b788849.png) link NEXT-1176 --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:49:43 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T8103 Binaries: Node: 17.9.1 npm: 8.11.0 Yarn: 1.22.10 pnpm: N/A Relevant packages: next: 13.2.5-canary.19 eslint-config-next: 13.2.4 react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://github.com/Dkogan90/next-bug
To Reproduce
Starting next:
yarn run dev
try to debugging
pages/api/hello.ts
with chrome node inspectorDescribe the Bug
Inspector is already running.
Unable to debug server-side code.
Expected Behavior
Able to debug server side code with the node.js inspector via chrome
Which browser are you using? (if relevant)
Chrome
How are you deploying your application? (if relevant)
not relevant
The text was updated successfully, but these errors were encountered: