Home > Back-end >  Larave & Vite - Vite manifest missing odd files
Larave & Vite - Vite manifest missing odd files

Time:08-27

enter image description here

In this image there are 5 separate images all in the same folder. When I run npm run build the manifest file is generated and two of the files are not entered (favicon-32x32|16x16).

The images are clearly present;

enter image description here

When this goes into production I get the following 500 error;

[2022-08-26 14:30:52] production.ERROR: Unable to locate file in Vite manifest: resources/images/favicon/favicon-32x32.png. {"view":{"view":"/home/forge/myproject/resources/views/app.blade.php","data":[]},"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Unable to locate file in Vite manifest: resources/images/favicon/favicon-32x32.png. at /home/forge/myproject/vendor/laravel/framework/src/Illuminate/Foundation/Vite.php:539)

Is there any reason why these files would not be added to the manifest?

CodePudding user response:

Could you give it a shot with an absolute path? /resources vs resources.

Furthermore, check the size of your assets. I ran into an issue a couple of days ago where images smaller then 4kb would be inlined trough base64.

As stated in the vite docs

Assets smaller in bytes than the assetsInlineLimit option will be inlined as base64 data URLs.

I posted a question about that. See How to make Laravel Vite copy static assets versioned to build folder

Last thing to check is to make sure you run npm run build on production, might clear your views as well while you're at it by doing a php artisan view:clear

  • Related