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

rudolfbruder's avatar

Assets not working after npm run build

Hi,

I have followed docs my assets and projects works after npm run dev. However when I run npm run build my page does not load and i recieve an error such as:

Unable to locate file in Vite manifest: resources/assets/images/hero/boxes_1.png.

Yes i have these lines in my app.js

import.meta.glob(["../assets/images**"]);
import.meta.glob(["../assets/svg**"]);

and i also tired adding this to aliases in app.php

        'Vite' => \Illuminate\Support\Facades\Vite::class,

I am trying to get my my image in blade like this:

            <img src="{{ Vite::asset('resources/assets/images/hero/boxes_1.png') }}" alt="phone illustration">

and it causes the error. It's like vite ignores the image import during build process.

Anybody can help please? Thanks!

0 likes
5 replies
MohamedTammam's avatar
Level 51

Delete the hot file from the public folder.

1 like

Please or to participate in this conversation.