Allow server.open to be passed `readonly string[]` as per `open` spec
See original GitHub issueDescription
Currently, as per the vite types, server.open can only accept boolean | string
→ https://github.com/vitejs/vite/blob/26bcdc3186807bb6f3817119cd7e64ae8308a057/packages/vite/src/node/http.ts#L37
Further more, the Vite docs say:
server.open See the open package for more details.
When checking the Open docs, for best cross-platform support, they suggest to set the browser like so:
const open = require('open');
await open('https://google.com', {
app: {
name: open.apps.chrome
}
});
Ref: https://github.com/sindresorhus/open#openapps
However, trying to use open.apps.chrome in Vite like so, gives a type error:
server: { open: open.apps.chrome }

Suggested solution
We need to be able to set Chrome but make sure it works for both Windows and MacOS.
My suggestion is to allow readonly string[] which is returned by open.apps.chrome so that we can use this option in the Vite config.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that request the same feature to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How to Configure Read-Only Routing for an Availability Group ...
In this article we will try to explain how to configure read-only routing for an Availability Group in SQL Server 2016 and how...
Read more >OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >OpenAPI Specification v3.0.3 | Introduction, Definitions, & More
The OpenAPI Specification allows combining and extending model definitions using the allOf property of JSON Schema, in effect offering model ...
Read more >Connect to an availability group listener - SQL Server Always On
While availability group listeners enable support for failover redirection and read-only routing, client connections are not required to use ...
Read more >MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
When bind_address names a list of multiple values, the server listens on one socket per value, with each socket bound to a single...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @sapphi-red for the find! I think it’s nice if we can upstream the changes, we would probably have to have it as a normal dependency then, and re-export the
appvariable. But also, looks like Sindre prefers no to use an applescript: https://github.com/sindresorhus/open/issues/256#issuecomment-868984143@bluwy
This is to reuse the existing tab. By using AppleScript, we can reuse it on macOS+Chromium base browsers. (It does not work with other OS/browers though…)
openwill open a new tab everytime.