If you don't need to compile js or css, you can just run npm run build once
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.
@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.
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....
@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?
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.
@Denzel So everything is gone inside the /public/build directory? And do you have a file in resources/css/app.css?
No, in the public/build, there are the assets>>js and #, and yes, the resources/css/app.css file is there.
@Denzel Can you show the content of your manifest.json file?
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...
@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?
I really must run the npm install and npm run dev each time I launch the project-- this is seeming so unreliable.
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" } }
@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
@Sinnbeck would you mind retyping the code from the manifest.json code I just sent, with the changes you're prescribing, Sir?
A workaround would be to load your css via your js, in case you are building a spa https://laravel.com/docs/9.x/vite#configuring-vite
I have read that it should work on windows
@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"
@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.
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.
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.
@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 when it's released you should just be able to run npm update
But then, the automatic reload doesn't seem to be working... would you be knowing of how to go about that?
@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
@sinnbeck, copy that. Thank you so much.
@Denzel oh and you can check this page daily to see if it's been released https://github.com/vitejs/vite/releases
Happy to help
@Sinnbeck oh, okay. Thank you.
The npm run dev works well now, thank you once again, @sinnbeck.
A fix has been released :) npm update and it should work https://github.com/vitejs/vite/blob/v3.0.4/packages/vite/CHANGELOG.md
Please or to participate in this conversation.