-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runner
Description
Describe the bug
There are cases where the local server needs to be configured for HTTPS; mixed content is a problem and certain browser APIs require HTTPS.
When vite is configured with a SSL certificate (e.g. via @vitejs/plugin-basic-ssl or mkcert), the protocol used to access localhost switches to HTTPS. When vitest in Browser Mode runs tests, it fails to connect to the in-browser runner because it attempts to navigate to http://localhost rather than https://localhost.
Reproduction
https://github.com/zmullett/vitest-https-repro
ninr test- Observe
Error: page.goto: net::ERR_EMPTY_RESPONSE at http://localhost:5173/?path=demo.test.js&id=demo.test.js
System Info
System:
OS: macOS 14.2.1
CPU: (8) arm64 Apple M2
Memory: 880.69 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.0.0 - /opt/homebrew/bin/node
Yarn: 1.22.21 - /opt/homebrew/bin/yarn
npm: 10.2.0 - /opt/homebrew/bin/npm
pnpm: 8.9.2 - ~/Library/pnpm/pnpm
bun: 1.0.3 - ~/.bun/bin/bun
Browsers:
Chrome: 120.0.6099.129
Safari: 17.2.1
npmPackages:
@vitejs/plugin-basic-ssl: ^1.0.2 => 1.0.2
@vitest/browser: ^1.1.1 => 1.1.1
vitest: ^1.1.1 => 1.1.1Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feat: browserIssues and PRs related to the browser runnerIssues and PRs related to the browser runner