nuxt/cli

devServer.https is ignored

Closed this issue · 1 comments

Environment


  • Operating System: Windows_NT
  • Node Version: v18.16.1
  • Nuxt Version: 3.7.1
  • CLI Version: 3.7.3
  • Nitro Version: 2.6.2
  • Package Manager: yarn@3.2.1
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/p/sandbox/https-issue-qw2k8z - devServer.https set to true.
https://codesandbox.io/p/sandbox/https-issue-withcert-3wk464 - devServer.https configured with cert.

Describe the bug

When I set devServer.https to true or provide a cert/key running nuxt dev still runs the dev server using http.

Tried this in 3.6.5 and it works as expected.

image

Reproduction on codesandbox... note that the terminal shows http:// in both instances.

Trying to access https:// regardless of the terminal output does not work, the site only responds on http.

Additional context

export default defineNuxtConfig({
  devServer: {
    https: true
  }
})

Logs

> npx nuxt dev
Nuxt 3.7.1 with Nitro 2.6.2                                                                                                                                                                                                     09:51:30  
                                                                                                                                                                                                                                09:51:31  

              █▀▀▀▀▀▀▀███▀█▀▀████▀▀▀▀▀▀▀█
              █ █▀▀▀█ █▄█▄█▀▄▄ ██ █▀▀▀█ █
              █ █   █ █▄ ▄█▄▄▀█▄█ █   █ █
              █ ▀▀▀▀▀ █ ▄▀▄ █▀▄▀█ ▀▀▀▀▀ █
              █▀▀▀▀▀█▀▀▀ ▄ █▀▄ ▀▀█▀█▀█▀██
              ██ ▄ ▀ ▀▀▄█ █▄ ▄▀█▄▀▀▀▀█ ▀█
              █  █ ▀ ▀▄ ▀▀█ ▀█▀▀█▀ ▀█▀▀ █
              █ ▄▄▀ ▀▀▄▀▄█▀▀▀▄▀█▀█▀█ █ ▀█
              █ █   █▀▀▀▄▀ ▀▀▄█ ▀▀▀▀▄▀█▄█
              █▀▀▀▀▀▀▀█ █ █▄█▄▄ █▀█   ▀▀█
              █ █▀▀▀█ █▀▄█ ▀▀█  ▀▀▀  ▀▄▄█
              █ █   █ █  █▄ █▄▄█▀▄▄▄█ ▄ █
              █ ▀▀▀▀▀ █  ▀█▄▀█▀▄█▄   ▀▀ █
              ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

  ➜ Local:    http://localhost:3000/
  ➜ Network:  http://172.24.208.1:3000/ [QR code]
  ➜ Network:  http://192.168.149.65:3000/

✔ Nuxt Devtools is enabled v0.5.5 (experimental)                                                                                                                                                                               09:51:33   
ℹ [nuxt] compiled plugins/client.mjs in 931.03ms                                                                                                                                                                               09:51:35   
ℹ Vite client warmed up in 8502ms                                                                                                                                                                                              09:51:44
✔ Nitro built in 6622 ms

Thank you @pi0 & @danielroe for the quick fix.