vite-plugin-basic-ssl
vite-plugin-basic-ssl copied to clipboard
Invalid certificate
I get this error :
Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://127.0.0.1:5173/src/') with script ('https://127.0.0.1:5173/src/sw.ts'): An SSL certificate error occurred when fetching the script.
And this is my vite.config.ts file : ` import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; import basicSsl from '@vitejs/plugin-basic-ssl'
// https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), basicSsl() ], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, server: { https: true }, }); `
Also, I have vue 3.2.45 and vite 3.2.4.
And I launch the dev server with the command
npm run dev -- --https