rsnext/packages/next/cli
Will Binns-Smith 643447ed03
Allow port 0 in next dev and next start (#40118)
This addresses a bug where invoking `next dev` or `next start` with `--port 0` would fall back to the default port of 3000 instead of binding to port 0 (which typically results in the operating system assigning a free port).

I couldn't find a straightforward way of adding a test for next-start. It looks like we could add a similar test as for dev, but would need to generate a built project to serve. 

Manual test plan for `next start`:
```
$ ./packages/next/dist/bin/next start --port 0
ready - started server on 0.0.0.0:53508, url: http://localhost:53508
```

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Wyatt Johnson <accounts+github@wyattjoh.ca>
2022-08-31 17:13:39 -05:00
..
next-build.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
next-dev.ts Allow port 0 in next dev and next start (#40118) 2022-08-31 17:13:39 -05:00
next-export.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00
next-info.ts Enable @typescript-eslint/no-use-before-define for functions (#39602) 2022-08-15 10:29:51 -04:00
next-lint.ts [ESLint] Adds --output-file flag (#36420) 2022-08-08 05:29:23 +00:00
next-start.ts Allow port 0 in next dev and next start (#40118) 2022-08-31 17:13:39 -05:00
next-telemetry.ts fix(next): dev server starting when importing a file using get-projec… (#38274) 2022-08-07 17:31:30 +00:00