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

Owaiz_Yusufi's avatar

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

0 likes
21 replies
Sinnbeck's avatar

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's avatar

@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

1 like
Owaiz_Yusufi's avatar

@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's avatar

@Owaiz_Yusufi hmm strange. There are no lines from your code. Did you accidentally cache your app

php artisan optimize:clear 
Owaiz_Yusufi's avatar

@Sinnbeck Well currently it gives me some thing different the images folder error

import.meta.glob([
    '../images/**',
]);
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@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?

1 like
Owaiz_Yusufi's avatar

@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

Sinnbeck's avatar

@Owaiz_Yusufi you need the name inside the function

<img src="{{Vite::asset('resources/images/profile-11.jpeg')}}" alt="avatar"> 
1 like
Owaiz_Yusufi's 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

Please or to participate in this conversation.