Skip to content
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

VSCode Debugging broke after upgrading from version 9.2.2 to 9.3.0 #11095

Closed
cadamsdev opened this issue Mar 16, 2020 · 6 comments
Closed

VSCode Debugging broke after upgrading from version 9.2.2 to 9.3.0 #11095

cadamsdev opened this issue Mar 16, 2020 · 6 comments

Comments

@cadamsdev
Copy link

cadamsdev commented Mar 16, 2020

Bug report

Debugging through VSCode no longer works

Describe the bug

When running debugger through VSCode console after upgrading from version 9.2.2 to 9.30 the console spams
"Starting inspector on 127.0.0.1:9229 failed: address already in use" but the address is not in use.

baydash on master [!] is 📦 v1.0.0 via ⬢ v12.13.0 on ☁️  us-east-2 
❯  cd /Users/crazypanda/Workspaces/baydash ; env NODE_OPTIONS=--inspect-brk /usr/local/bin/node node_modules/.bin/next 
Debugger listening on ws://127.0.0.1:9229/61643430-1b26-4c6b-864e-6413d4daf6b9
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:3000 ...
Starting inspector on 127.0.0.1:9229 failed: address already in use
Starting inspector on 127.0.0.1:9229 failed: address already in use
Starting inspector on 127.0.0.1:9229 failed: address already in use
Starting inspector on 127.0.0.1:9229 failed: address already in use

To Reproduce

  1. Use Next.js version 9.3.0
  2. Create a Next.js app
  3. Create a launch.json file (for VSCode)
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Debug App",
            "program": "${workspaceFolder}/node_modules/.bin/next",
            "port": 9229,
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}",
            "env": {
                "NODE_OPTIONS": "--inspect-brk"
            }
        }
    ]
}

In VSCode run the debugger
image

Expected behavior

Should not say "Starting inspector on 127.0.0.1:9229 failed: address already in use". The server should run and you should be able to set breakpoints in VSCode.

image

System information

  • OS: MacOS
  • Browser (if applies) Microsoft Edge (Chromium)
  • Version of Next.js: 9.3.0

Additional context

This does not happen in version 9.2.2

@pecoram
Copy link

pecoram commented Mar 18, 2020

any news about this issue?

@cadamsdev
Copy link
Author

cadamsdev commented Mar 18, 2020

@pecoram Here's a related issue #11030

PR: #10807

@cadamsdev
Copy link
Author

cadamsdev commented Mar 19, 2020

Going to close this ticket. I was able to get debugging in VSCode working by removing --inspect-brk. Seems like Next version 9.3.1 calls --inspect under the hood. See #11030 (comment)

This VSCode launch.json works for me.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Debug App",
            "program": "${workspaceFolder}/node_modules/.bin/next",
            "console": "integratedTerminal",
            "cwd": "${workspaceFolder}"
        }
    ]
}

@realfunkyusername
Copy link

realfunkyusername commented Apr 6, 2020

@chadalen and what do I do if I use TypeScript? Placing a breakpoint shows a warning that SourceMaps aren't found. Using "sourceMap": true didn't help

@JoseFMP
Copy link

JoseFMP commented Jul 1, 2020

Same issue here. Wondering, any plans to fix this?

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants