Laravel jetstream using vite

Viewed 1854

sorry in advance my english is bad

I have a problem when I will use laravel jetstream for my project. Because when i used stack livewire, the display doesn't match, here I give the output result enter image description here

And also I've run npm install & npm run dev so it will run development using mix as default Here I will give the project folder structure enter image description here

maybe what I can conclude is to change the development process from mix to vite, or there are hints from the experts here on how to solve the problem?. Thank you in advance

4 Answers

Actually you can fix this issue by replacing the @vite with these one in views/layouts/app and guest blade.

<!-- Styles -->
<link rel="stylesheet" href="{{ mix('css/app.css') }}">

<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>

because you install previous version of laravel, @vite was added in 9.+ laravel so i think its just bc you using 8. (any <9) version, just install previous jetstream version for example composer require laravel/jetstream:2.7.0

go to resources\views\layouts\guest.blade.php and resources\views\layouts\app.blade.php and replace below code, if its not there, just insert below code in these two files. and also remember to comment out @vite line, see below screenshot. see screenshot I hope it will solve the problem.

<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>

this can help you to solve @vite : php artisan view:clear

Related