How To Setup HTTPS on localhost
I've read through the Vite docs, and they suggest using the
@vitejs/plugin-basic-ssl
or vite-plugin-mkcert
plugin to enable HTTPS on your localhost.
I've tried the following two options and neither work.
When I install mkcert
and configure vite.config.ts
as follows, the server won't start when I run npm run dev
.
Alternatively, when I install basic-ssl
and configure vite.config.tx as follows, the server will start, but I get a host of errors on http, and https won't load at all.
Here are the errors on https:
Here's the error on https:
Any suggestions would be appreciated.
Thanks.3 Replies
i setup a caddy reverse proxy and trust the caddy cert on a dev browser
i've just used 'npm install -D @vitejs/plugin-basic-ssl'
is there any update for this? or can someone explain to me why the mkcert plugin does not work? it works flawlessly for my analog app, so I had hoped it would work just as well for Start