Is it a Laravel project ?
Jul 26, 2023
5
Level 3
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!
Level 51
Delete the hot file from the public folder.
1 like
Please or to participate in this conversation.