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

shaileshghadge's avatar

Breeze Install - Have to keep running npm run dev in separate window

Hello,

I using xampp with php8.1 During Installation of Breeze Authentication, After running npm run dev, this screen comes, showing a continuous active process VITE & LARAVEL. [screenshot link removed as not allowed]

As I dont get the prompt to enter next command, I ran 'migrate' command in another window. After running migrate command in separate window the tables were created successfully. I'm also getting the Login page & Register page.

But, If I closed the npm run dev window, the Login & Register page give error 'Vite manifest not found' as seen in screenshot. [screenshot link removed as not allowed]

When I keep running npm run dev, then there is no error. Then, Login & Register page loads without above error.

So, I have to keep two windows running.. one for php artisan server & one for npm run dev This doesnt seem proper behaviour.

Pl help.

0 likes
23 replies
Sinnbeck's avatar

That's exactly what you need to do while developing. You have 1 dev server for php, and one for js/css.

Unless you set up xampp to work as webserver for php. Then you can skip the serve command :)

And if you don't need to change js or css and only work on php, you can just run npm run build. Now you don't need npm run dev anymore. It's also what you do for production

2 likes
shaileshghadge's avatar

@Sinnbeck Thanks for replying I ran npm run build successfully. But, it still gave error on loading login page

Exception PHP 8.1.6 9.21.3 Unable to locate file in Vite manifest: resources/css/app.css.

But, when I run npm run dev, no error. Login works, Dashboard loads. Additionally, if I modify my view (.blade.php), then the UI breaks. Asset files become 404. To resolve, I have to restart both commands (php artisan server) (npm run build) in separate window, then it load correctly.

1 like
Sinnbeck's avatar

@shaileshghadge there seems to be a bug currently, where the manifest file gets the wrong slashes in a path (windows only). Can you show the content if your manifest file?

shaileshghadge's avatar

@Sinnbeck Pl find below content of public/build/manifest.json

{
  "resources/js/app.js": {
    "file": "assets/app.ab93cf8a.js",
    "src": "resources/js/app.js",
    "isEntry": true
  },
  "resources/css\app.css": {
    "file": "assets/app.72cbd360.css",
    "src": "resources/css\app.css"
  }
}
shaileshghadge's avatar

@Sinnbeck Thanks. So, until official fix is released, I will need to keep updating this everytime I run build.

Sinnbeck's avatar

@shaileshghadge Sadly yes. You can probably also get around it by running your dev environment on WSL2 (linux for windows)

shaileshghadge's avatar

@Sinnbeck Actually since past couple of days, I was trying out WSL2 with Docker Desktop.

And it is not a good option for me.

Enormous memory was getting used. Everything was getting hanged. To fix that, limited the memory, using wsl's config, Then, Hard disk I/O was hitting 100%, which again hanged all applications.

So, returned back to xampp setup.

Sinnbeck's avatar

@shaileshghadge Ouch. Sounds bad :) Hopefully they will release the fix very soon. Run npm update daily and hope it has been fixed

Denzel's avatar

Hello @shaileshghadge, I also realized that, with the new version 9.21, one has to run the npm install and npm run dev once you close and reopen the project again, a project with jetstream livewire, which wasn't the case in 9.20.

1 like
thinkverse's avatar

It is proper behavior and it's doing what it's designed to do. npm run dev is like running npm run watch and npm run hot with Laravel Mix, only with Vite it is in one command.

The command is not for production use, hence the script name dev, and is supposed to be started when you're developing your site. It has some advantages over Laravel Mix's dev script in that it includes asset watching and hot module reloading out-of-the-box. As opposed to Laravel Mix where you had to use either watch or hot to achieve the same result. Or if you used Laravel Mix's dev you had to reload the page yourself afterwards.

For production use, you have to build your assets with npm run build. That will generate the necessary manifest.json file and asset files and place them in public/build, a folder you can then deploy with your site.

1 like
shaileshghadge's avatar

@thinkverse Thanks for replying. I ran npm run build successfully. But, it still gave error on loading login page

Exception PHP 8.1.6 9.21.3 Unable to locate file in Vite manifest: resources/css/app.css.

But, when I run npm run dev, no error. Login works, Dashboard loads. Additionally, if I modify my view (.blade.php), then the UI breaks. Asset files become 404. To resolve, I have to restart both commands (php artisan server) (npm run build) in separate window, then it load correctly.

Snapey's avatar

you can run the equivalent of the old npm run watch command with a small change

https://laracasts.com/discuss/channels/vite/equivalent-of-vite-watch

leaving this running will ensure your build folder always has current assets

Note that with tailwind JIT compiler you need to be continually building assets as you edit your blade files so that the css contains the tags you are using.

none of this should have anything to do with your app returning 404s ... that's some other issue

shaileshghadge's avatar

@Snapey Thanks for replying, I updated package.json as per your link And then closed all, ran php artisan serve and then npm run watch.

PS C:\xampp8\htdocs\Project2\basic> npm run watch
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> watch
> vite build --watch

vite v3.0.2 building for production...

watching for file changes...

build started...
āœ“ 59 modules transformed.
public/build/manifest.json             0.23 KiB
public/build/assets/app.72cbd360.css   25.25 KiB / gzip: 4.95 KiB
public/build/assets/app.ab93cf8a.js    129.03 KiB / gzip: 46.77 KiB
built in 16109ms.

Loaded login page in fresh opened inprivate/incognito window, gave error

Exception PHP 8.1.6 9.21.3
Unable to locate file in Vite manifest: resources/css/app.css.

Then, terminated 'watch' and ran npm run dev, then login page loaded without error.

But, if I modify my view (.blade.php), then the UI breaks. Asset files become 404. To resolve, I have to restart both commands (php artisan server) (npm run dev) in separate window, then it loads correctly.

thinkverse's avatar

@shaileshghadge Could this be the same issue that @rajoyish had in "unable-to-locate-file-in-vite", where the CSS path generation added a backslash \ instead of a / slash in the manifest.json?

If it's the same issue it's an issue with Vite 3 specifically on Windows. A user has opened an issue on Vite's GitHub. Hopefully, they'll resolve the issue or give Windows users a way to fix it themselves.

shaileshghadge's avatar

@thinkverse For me, it did load properly when I restart both commands (php artisan server) (npm run dev) in separate window. But, consequent changes in *.blade,php used to break the UI.

thinkverse's avatar

@shaileshghadge That's how build works, it builds the assets once at the state it's in at that time of the command being run. It's used, as it says in the Laravel docs.

Build and version the assets for production...

artisan serve on the other hand starts a local PHP development server using PHP's built-in web server, which is designed for testing and development. When using build that is what serves your Laravel application and assets found in /public/build.

For hot reloading of assets like Laravel Mix's watch or hot you need to use npm run dev. With that Vite will start a node server for you, and when it notices changes in either your own specified refresh paths or the ones defined by laravel-vite-plugin it'll refresh the browser and rebuild the assets.

Note that dev will only keep the assets rebuilt for the duration the Vite development server is live. When closed the changes made won't be built and persisted in public/build. You'll have to run build yourself before deploying your site or run it in a CI/CD pipeline that's automatically run when you push to production.

shaileshghadge's avatar

@thinkverse Sorry, i wrongly wrote.build, instead of dev in my reply to you...(i have corrected that) For build it didnt work at all. Without workaround, it worked after restarting serve & dev

Currently, with the workaround everything works.

Please or to participate in this conversation.