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

Typings incorrect for CommonServerOptions https, should be | boolean #17580

Closed
7 tasks done
damiangreen opened this issue Jun 27, 2024 · 1 comment · Fixed by #17586
Closed
7 tasks done

Typings incorrect for CommonServerOptions https, should be | boolean #17580

damiangreen opened this issue Jun 27, 2024 · 1 comment · Fixed by #17586
Labels
contribution welcome documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@damiangreen
Copy link

Describe the bug

setting preview> https: true in vite.config
![image](https://github.com/vitejs/vite/as
sets/1592820/ba15f4d5-8ee8-4926-be81-9eeab3eec984)

Reproduction

.

Steps to reproduce

Create a vite config with
preview: { https: true}
Get compilation error:
Type 'true' has no properties in common with type 'ServerOptions'.ts(2559)

I thikn this line

https?: HttpsServerOptions

needs changing to
https?: HttpsServerOptions | boolean

to satisfy the docs at https://vitejs.dev/config/preview-options#preview-https

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
    CPU: (16) x64 13th Gen Intel(R) Core(TM) i7-1360P
    Memory: 2.32 GB / 30.96 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 21.7.1 - ~/.nvm/versions/node/v21.7.1/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v21.7.1/bin/npm
    pnpm: 9.1.3 - ~/.local/share/pnpm/pnpm
  npmPackages:
    @vitejs/plugin-basic-ssl: ^1.1.0 => 1.1.0 
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 
    vite: ^5.2.13 => 5.3.1

Used Package Manager

pnpm

Logs

No response

Validations

@bluwy
Copy link
Member

bluwy commented Jun 28, 2024

It should not have the boolean as it's no longer useful since v5: https://vitejs.dev/guide/migration.html#remove-https-flag-and-https-true. Looks like we need to update that section to reflect this, it's already updated for server.https but not preview.https

@bluwy bluwy added documentation Improvements or additions to documentation good first issue Good for newcomers contribution welcome and removed pending triage labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants