Skip to content

Still getting 'address already in use' using --inspect on typescript projects #11821

@mjyoung

Description

@mjyoung

Bug report

When using NODE_OPTIONS='--inspect' next dev -p 1337 I'm still getting the error:
Starting inspector on 127.0.0.1:9229 failed: address already in use

Describe the bug

From what I understand, this bug should have been fixed as of #11041.

However, I still get the error:

npm run dev

> frontend@0.1.0 dev 
> NODE_OPTIONS='--inspect' next dev -p 1337

Debugger listening on ws://127.0.0.1:9229/90c3d543-273f-492c-a8f6-bb3afd978e64
For help, see: https://nodejs.org/en/docs/inspector
[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:1337 ...

Starting inspector on 127.0.0.1:9229 failed: address already in use

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Edit package.json's dev script:
 "scripts": {
    "dev": "NODE_OPTIONS='--inspect' next dev -p 1337",
    ...
  },
  "dependencies": {
    "next": "9.3.4",
    ...
  },
  1. npm run dev or yarn dev
  2. See error
npm run dev

> frontend@0.1.0 dev 
> NODE_OPTIONS='--inspect' next dev -p 1337

Debugger listening on ws://127.0.0.1:9229/90c3d543-273f-492c-a8f6-bb3afd978e64
For help, see: https://nodejs.org/en/docs/inspector
[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:1337 ...

Starting inspector on 127.0.0.1:9229 failed: address already in use

Expected behavior

Do not see address already in use error

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: 9.3.4 (also tried on 9.3.5-canary.7)
  • Version of Node.js: 12.16.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions