[Vuejs]-How to run Vue on port 5173 when using Laravel? – This is the Vite development server that provides Hot Module Replacement

0πŸ‘

βœ…

The first and main problem was that the app was started from the wrong folder. It needs to be started from vue subfolder:

laravel: myapp> php artisan serve

vue: myapp\vue> npm run dev

The second problem was that after opening localhost:5173 nothing was shown: I needed to change const { createStore } = require("vuex"); to import { createStore } from "vuex";

0πŸ‘

I think you see what you should, im currently working on laravel-vue-vite project and when i installed it i also had Laravel dashboard

To run laravel localy

php artisan serve

And for vite you run
For localy

npm run dev

For production

npm run build

Note that they both should be run at same time in Visual studio code to do that you need open second terminal so press "+" icon in right top corner of terminal

If you installed laravel with vue your views are stored in resources/js

And routes in routes/web.php

enter image description here

Leave a comment