How to know if vite has successfully build my project? I have build my laravel project and now it should work without using npm run dev command right?
If that the case then why I am getting this error :
Unable to locate file in Vite manifest:
When I shut down the npm run dev server ( vite )
https://prnt.sc/jOPM5iru_b3v
Running npm run dev just starts a dev server. It builds nothing. To do that you need to run npm run bulld
But this error seems more to be the fact that you forgot to use an array in @vite (). The second argument is the build path and should be blank
@Sinnbeck wait! you mean
@vite(['resources/assets/scss/custom.scss', ' ' ])
@Owaiz_Yusufi Yup
@vite('resources/foo/bar.js', 'resources/assets/scss/custom.scss') //wrong
@vite(['resources/foo/bar.js', 'resources/assets/scss/custom.scss']) //correct
But it is only based on the image. I cannot say for absolutely certain
@Sinnbeck But I have defined my SCSS like
@vite(['resources/assets/scss/custom.scss' ])
@Sinnbeck No did not change it any thing but still did not work
could you tell me if this is right method
@vite(['resources/assets/scss/custom.scss' ])
If my above code is right then why I am getting those errors
@Sinnbeck I did npm run build. Now I am turning off the dev server
@Owaiz_Yusufi can you share the actual error page instead of an image? There should be a share button
@Owaiz_Yusufi hmm strange. There are no lines from your code. Did you accidentally cache your app
php artisan optimize:clear
@Sinnbeck Well currently it gives me some thing different the images folder error
import.meta.glob([
'../images/**',
]);
@Owaiz_Yusufi yeah I just noticed the error changed?
Unable to locate file in Vite manifest: resources/images/.
That means it now finds the manifest at least. But you must be trying to get something in a wrong way. Are you referencing resources/images/. in blade?
@Owaiz_Yusufi I gave you the command to clear cache. Give it a shot
@Sinnbeck Ok here is a thing. I am using below code to render my images. Is it right?
<img src="{{Vite::asset('resources/images/')}}profile-11.jpeg" alt="avatar">
I did it as I have tons of pages that's why
@Owaiz_Yusufi you need the name inside the function
<img src="{{Vite::asset('resources/images/profile-11.jpeg')}}" alt="avatar">
@Sinnbeck let me change it to all my pages and then i will let u know as it's going to take some time
@Sinnbeck Ok I think I manage to solve that issue. thanks
Please sign in or create an account to participate in this conversation.