Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lat4732's avatar
Level 12

dev server running at http://localhost:3000 not accessible

I just created a brand new laravel project with vue. The commands I runned:

composer create-project laravel/laravel laravelvue
composer require laravel/ui
php artisan ui vue --auth
npm install

and when I run

npm run dev

I get the following

> dev 
> vite


  vite v2.9.13 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 240ms.


  Laravel v9.19.0 

  > APP_URL: http://localhost

But when I open in the browser http://localhost:3000 I get a 404 not found error in the console log.

GET
http://localhost:3000/

Status
404 Not Found

Am I doing something wrong?

0 likes
13 replies
Sinnbeck's avatar

Your not suposed to open that url. Just url your regular app url. The vite url is something vite uses for you automatically in the browser

Sinnbeck's avatar

@Laralex then you need to fix xampp. Vite does not serve your app. Only css and js

lat4732's avatar
Level 12

@Sinnbeck Am I supposed to run npm run dev && php artisan serve at the same time? I mean will they conflict somehow?

lat4732's avatar
Level 12

@Sinnbeck And btw why when I run npm run dev I still can't access public/css/app.css and public/js/app.js files? Here's my webpack.mix.js

const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
    .vue()
    .sass('resources/sass/app.scss', 'public/css');

And here's what I'm trying to do

<link rel="stylesheet" href="/css/app.css">


<script src="/js/app.js"></script>
Sinnbeck's avatar

@Laralex if you use php artisan serve for running your app, then yes, you need to run both at the same time

Sinnbeck's avatar

Vite runs a dev server that embeds the css and js directly into the page. It does not create any files (unless you run npm run build)

zxywvu's avatar

I installed this auth

S  npm run dev

> dev
> vite


  vite v2.9.14 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 699ms.


  Laravel v9.20.0

  > APP_URL: http://localhost

What's the solution?

Sinnbeck's avatar

@esfer if your answer isn't already in this thread, I suggest you create a new one. Your problem might be completely different and it's impossible to help 2 people with similar problems in one thread

Snapey's avatar

@esfer What you showed is exactly as expected. Open a new question if you have a problem

thinkverse's avatar

Laravel UI v3 is not compatible with Laravel 9 and Vite. UI v3 and lesser use Laravel Mix and not Vite like Laravel 9 v9.19 and up.

To use Laravel UI with Laravel 9 and Vite you need to use the dev version of Laravel UI, which will be v4 sometime in the future, that merged support for Vite like 13 hours ago at the time of writing.

composer require laravel/ui:dev-master
1 like
Daniel-Pablo's avatar

How did you solve this? what is the URL that you use?

http://localhost

I enter into my localhost but got the same error, after running

npm run dev
php artisan serve

Thanks in advance

Daniel-Pablo's avatar

For MAC - after running

npm run dev
php artisan serve

then the URL you have to enter is not local host, you must enter

http://localhost:8000
or
http://127.0.0.1:8000

this is the URL of the server and is been modified by VITE, just in case someone runs into the same stuff

Please or to participate in this conversation.