Skip to content

fix: log actual adapter-node listening address#15899

Open
puneetdixit200 wants to merge 1 commit into
sveltejs:mainfrom
puneetdixit200:fix/15880-adapter-node-listening-address
Open

fix: log actual adapter-node listening address#15899
puneetdixit200 wants to merge 1 commit into
sveltejs:mainfrom
puneetdixit200:fix/15880-adapter-node-listening-address

Conversation

@puneetdixit200
Copy link
Copy Markdown

closes #15880

This fixes the adapter-node startup log so it uses the actual bound server address instead of manually echoing the configured host and port.

That matters when PORT=0, because Node binds an available random port and the old log still printed port 0. The new helper also formats IPv6 hosts with brackets so the logged address is a valid URL.


Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Scoped adapter-node commands run:

  • pnpm --dir packages/adapter-node test
  • pnpm --dir packages/adapter-node lint
  • pnpm --dir packages/adapter-node check
  • pnpm --dir packages/adapter-node build
  • pnpm exec prettier --check .changeset/twelve-buses-smile.md packages/adapter-node/src/index.js packages/adapter-node/utils.js packages/adapter-node/tests/utils.spec.ts
  • pnpm exec eslint --cache --cache-location node_modules/.eslintcache packages/adapter-node/src/index.js packages/adapter-node/utils.js packages/adapter-node/tests/utils.spec.ts
  • git diff --check

The focused regression test failed before the fix because format_listening_address did not exist, then passed after the runtime helper was added.

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

Added a patch changeset for @sveltejs/adapter-node.

Edits

  • Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

🦋 Changeset detected

Latest commit: 21eb8d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/adapter-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node adapter prints wrong port in "Listening on" message

1 participant