hexojs / hexojs/hexo-server

Debugging in VScode: "port already in use" error

Open
#276 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
81
Forks
55
PR merge metrics
No merged PRs in 30d

Description

# Problem
hexo server fails to bind to `127.0.0.1` while using node inspector. If you explicitly define the IP and port the same as that configured for Node Inspector, it will fail to start.

```zsh
$(which hexo) clean && node --inspect-brk=4001 $(which hexo) server -i localhost -p 4001 --debug
```

![Screenshot 2023-02-22 at 12 23 27](https://user-images.githubusercontent.com/1673222/220513742-a7197240-3374-4efd-9cfd-7ddfe5b1e34c.png)

However, if you don't define the IP and leave it to defaults, everything starts, but the browser doesn't reach the server over `127.0.0.1`...
```zsh
$(which hexo) clean && node --inspect-brk=4001 $(which hexo) server -p 4001
```

![Screenshot](https://user-images.githubusercontent.com/1673222/220513685-6b005fd0-2b50-42f5-a03e-c215085b15d4.png)

# Related issue
- https://github.com/hexojs/hexo-server/issues/275

# Environment
- MacOS 13.2.1

- node: v19.6.1
- Hexo:
- hexo: 6.3.0
- hexo-cli: 4.2.0
- os: Darwin 22.3.0 darwin x64
- node: 19.6.1
- v8: 10.8.168.25-node.11
- uv: 1.44.2
- zlib: 1.2.11
- brotli: 1.0.9
- ares: 1.19.0
- modules: 111
- nghttp2: 1.52.0
- napi: 8
- llhttp: 8.1.0
- uvwasi: 0.0.15
- acorn: 8.8.2
- simdutf: 3.1.0
- undici: 5.19.1
- openssl: 1.1.1t
- cldr: 42.0
- icu: 72.1
- tz: 2022e
- unicode: 15.0

# Expected behavior

Server should work Node inspector. How else does one troubleshoot issues if it won't bind on the same domain (IP) and port? IP alias?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.