What if you removed the last line in your vite config file ie server: { https: true, host: 'localhost', }, You remove this part of the code and see if it works
Jul 6, 2022
3
Level 13
npm run build works, but npm run dev doesn't
I've recently created a new project and using VITE for the first time. I'm running into a strange problem -
npm run build works fine and create proper asset urls. However, if I run npm run dev, I get following asset url
https://localhost:3000/@vite/client
Which doesn't work. I'm guessing some configuration related issue. Posting my vite configuration below -
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel([
'resources/css/app.css',
'resources/js/app.js',
]),
],
server: {
https: true,
host: 'localhost',
},
});
Would appreciate some help in identifying the issue. Thank you in advance!
Level 1
1 like
Please or to participate in this conversation.