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

Denzel's avatar

npm install and run dev on v 9.21, with Jetstream livewire

Hello, I have 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.

0 likes
31 replies
Sinnbeck's avatar

If you don't need to compile js or css, you can just run npm run build once

1 like
Denzel's avatar

@Sinnbeck Okay, I see, so I do that every time I wanna open the project?

1 like
Sinnbeck's avatar

@Denzel just once. It compiles your Javascript and css and puts it inside /public/built for future use. So only when you need to change js or css will you need to run it again

1 like
Denzel's avatar

@sinnbeck, Wow, thank you. I have run the npm run build, and hope it works even to the next time I reopen my project. Once again, thank you, Sir.

1 like
Denzel's avatar

Hello laravel community. @sinnbeck, unfortunately, the npm run build needs me to run it each time I launch the project, I don't know why it is so....

1 like
Sinnbeck's avatar

@Denzel Ok lets do some debugging then. When you run it, I assume that you get some compiled css/js inside /public/build ? If you then stop the project these files are removed or?

1 like
Denzel's avatar

Well, now I have just closed the project and reopened it, and when I click the login/register buttons, it brings an error "Unable to locate file in Vite manifest: resources/css/app.css."... before, it was running, but the display was really not in order.

1 like
Sinnbeck's avatar

@Denzel So everything is gone inside the /public/build directory? And do you have a file in resources/css/app.css?

1 like
Denzel's avatar

No, in the public/build, there are the assets>>js and #, and yes, the resources/css/app.css file is there.

1 like
Denzel's avatar

Hello @sinnbeck, sorry, which file is that? Is it located under a certain folder; I'm trying to search for it, but it doesn't seem to be there...

1 like
Sinnbeck's avatar

@Denzel I have mentioned the folder several times I think? /public/build

Can you explain how you are running the project on your computer? As it only seems to happen to you, I must assume that your work flow is different. What commands do you run to start the project?

1 like
Denzel's avatar

I really must run the npm install and npm run dev each time I launch the project-- this is seeming so unreliable.

1 like
Denzel's avatar

The following is the manifest.json file, Sir.

{ "resources/js/app.js": { "file": "assets/app.ab93cf8a.js", "src": "resources/js/app.js", "isEntry": true }, "resources/css\app.css": { "file": "assets/app.b7457a63.css", "src": "resources/css\app.css" } }

Sinnbeck's avatar

@Denzel ok so you running windows and have the vite bug that comes with vite 3, where it reverses / to \. You can change it manually until they write a fix

1 like
Denzel's avatar

@Sinnbeck would you mind retyping the code from the manifest.json code I just sent, with the changes you're prescribing, Sir?

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@Denzel sure. Check this example. Just fix both in the file and it should work :)

Wrong

"resources/css\\app.css" 

Correct

"resources/css/app.css" 
1 like
Denzel's avatar

@Sinnbeck yes, this one seems to be working. I have relaunched the project, and it seems okay. I really appreciate your help, I am building an online admission system for my campus, and this has been very instrumental-- I wish to pass my many thanks to you, Sir.

Denzel's avatar

So, when I open the project afresh (after maybe restarting my computer), I run the PHP artisan serve command only, and then the project launches on the browser, but the login/register pages turn out really disorganized... when I run the npm install and run dev, and reload, they out just fine.

So, I'm kinda worried about having to run these commands each time I launch the project, since it's a really significant project I'm building for my campus use.

Denzel's avatar

I actually think it works now, I have changed the \ to / in the resources/css/app.css in the manifest.json. Would you like to see from below: { "resources/js/app.js": { "file": "assets/app.ab93cf8a.js", "src": "resources/js/app.js", "isEntry": true }, "resources/css/app.css": { "file": "assets/app.19d0c134.css", "src": "resources/css\app.css" } }

This seems to be working.

1 like
thinkverse's avatar

@Denzel This is a known bug for Windows users, and a fix has been merged into Vite. It didn't get merged before the v3.0.3 release, but it'll be in the next release v3.0.4 since it's now been merged. Hopefully, this will fix the back slash issue for Windows users later. 👍

2 likes
Denzel's avatar

@thinkverse Oh, I see. Thank you for that heads-up. So, may I please ask, now since I built the project with the laravel version 9.21, (I don't know whether that is the v3.0.3 or the v3.0.4), would those merged fixes automatically come to my project then?

Denzel's avatar

But then, the automatic reload doesn't seem to be working... would you be knowing of how to go about that?

Sinnbeck's avatar

@Denzel the automatic updating needs to be started every time. That's just how it works. Just run npm run dev and leave it running while working

Please or to participate in this conversation.