Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`startUnbundledServer` ignores `listen.port: 0` and falls back to port 3000

Closed Beginner friendly
#4,880 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Read src/build/unbundled/serve.ts around line 69 and inspect how listen.port falls back to NITRO_PORT. Run the relevant case in test/unbundled/serve.test.ts, especially with port: 0. Done means port 0 is preserved and the parallel test no longer fails by binding to port 3000.

Written by the indexing model from the issue text.

Description

src/build/unbundled/serve.ts:69 uses opts.listen.port || process.env.NITRO_PORT, so port: 0 (random port) is dropped and the server listens on 3000. This makes test/unbundled/serve.test.ts fail with EADDRINUSE 127.0.0.1:3000 when another test holds port 3000 during a parallel run; using ?? should fix it.

Triaged with AI assistance.

Dominant language
TypeScript
Stars
11.3k
Forks
932
Avg merge
1d 14h
Merged PRs (30d)
164

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nitrojs/nitro

All issues in nitrojs/nitro

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.