[Vuejs]-Laravel 10 with vue doesn't work for me, the app.js file can't find it

0👍

Your error is that you are mixing URL::xxxx with Vite::asset.

This code:

<script type="text/javascript" src="{{ URL::asset('/js/app.js') }}"></script>

Should be:

@vite('resources/js/app.js')

Or at least:

<script type="text/javascript" src="{{ Vite::asset('resources/js/app.js') }}"></script>

Please, do READ the documentation: https://laravel.com/docs/10.x/vite#loading-your-scripts-and-styles

Leave a comment