Skip to content

fix(core): support IPv6 in devtools server link#204

Merged
webfansplz merged 2 commits intomainfrom
hotfix
Mar 16, 2026
Merged

fix(core): support IPv6 in devtools server link#204
webfansplz merged 2 commits intomainfrom
hotfix

Conversation

@webfansplz
Copy link
Copy Markdown
Member

Close #202

Copilot AI review requested due to automatic review settings March 16, 2026 14:13
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 16, 2026

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/@vitejs/devtools@204

@vitejs/devtools-kit

npm i https://pkg.pr.new/@vitejs/devtools-kit@204

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/@vitejs/devtools-rolldown@204

@vitejs/devtools-rpc

npm i https://pkg.pr.new/@vitejs/devtools-rpc@204

@vitejs/devtools-self-inspect

npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@204

commit: 867ffda

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the displayed DevTools server URL when binding to an IPv6 host by formatting IPv6 literals correctly (bracketed), closing #202.

Changes:

  • Added a small URL formatting helper to normalize host + port into a valid HTTP URL (including IPv6 bracket wrapping).
  • Updated the CLI “started at” log and --open behavior to use the normalized URL.
  • Added Vitest coverage for the new normalization behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/node/utils.ts Introduces normalizeHttpHost to format IPv6 hosts into valid bracketed HTTP URLs.
packages/core/src/node/cli-commands.ts Uses the helper for the logged/opened DevTools URL.
packages/core/src/node/tests/utils.test.ts Adds tests validating IPv4 localhost mapping, IPv6 bracketing, and non-IP preservation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@webfansplz webfansplz merged commit 83e09b5 into main Mar 16, 2026
12 of 13 checks passed
@webfansplz webfansplz deleted the hotfix branch March 16, 2026 14:35
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.

Devtools started link is invalid when server host is set to IPv6 address

2 participants