vite-plugin-basic-ssl icon indicating copy to clipboard operation
vite-plugin-basic-ssl copied to clipboard

Invalid certificate

Open cyril-tl opened this issue 2 years ago • 2 comments
trafficstars

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

cyril-tl avatar Nov 30 '22 09:11 cyril-tl