Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid URL when using https and --open in v6.1.0 #19408

Closed
7 tasks done
keatkeat87 opened this issue Feb 12, 2025 · 0 comments · Fixed by #19416
Closed
7 tasks done

Invalid URL when using https and --open in v6.1.0 #19408

keatkeat87 opened this issue Feb 12, 2025 · 0 comments · Fixed by #19416
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@keatkeat87
Copy link

keatkeat87 commented Feb 12, 2025

Describe the bug

After upgrading from v6.0.10 to v6.1.0, my code stopped working.

I found some differences
vite.config.ts

import { defineConfig } from 'vite'

export default defineConfig({
  server: {
    host: '192.168.0.152',
    port: 4200,
    https: {
      cert: '192.168.0.152.crt',
      key: '192.168.0.152.key',
    },
  },
});

v6.0.10 yarn dev
Image

v6.1.0 yarn dev
Image

In v6.1.0, there are two URLs. If I use yarn dev and visit https://192.168.0.152:4200/, it works fine. But if I run the command yarn dev --open, it shows an error.

Image

Note: but if I run vite --open, it works.

Reproduction

https://github.com/keatkeat87/vite-issue-https-open

Steps to reproduce

git clone https://github.com/keatkeat87/vite-issue-https-open

yarn install

yarn dev --open

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
    Memory: 17.28 GB / 31.76 GB
  Binaries:
    Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.70)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    vite: ^6.1.0 => 6.1.0

Used Package Manager

yarn

Logs

No response

Validations

@sapphi-red sapphi-red added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants