I guess you are missing this step: https://laravel.com/docs/10.x/vite#blade-processing-static-assets
So you need to make Vite aware of that file in your resources/js/app.js add this:
import.meta.glob([
'../js/**',
]);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've been using the approach of using Vite::asset to load JS or CSS files only needed in certain views, and it works normally while running npm run dev, but after running npm build, whenever I try to open views that are using Vite::asset I receive an error like this example below:
Unable to locate file in Vite manifest: resources/js/sortable.min.js
Any suggestions on how to fix this?
Please or to participate in this conversation.