Questions tagged [laravel-vite]
45 questions
12
votes
5 answers
Default Persistent Layout In Laravel + Inertia + Vite
In the previous way of setting up inertia in a laravel app, I could tweak the resolve property in the `createInertiaApp function from:
{
...,
resolve: name => import("./Pages/${name}"),
...
}
To
{
...,
resolve: name => {
const…

Willower
- 1,099
- 8
- 22
8
votes
1 answer
Why Laravel does not load Tailwind css styles installed with Laravel Breeze Starter Kit?
I have a Laravel 8 project, with PHP7 and wanted to try out Laravel Breeze, but after installing according to Laravel Documentation, Tailwind styles are not being reflected on my login and register pages.
At the top of the page there is a broken…

Abel Chipepe
- 372
- 2
- 11
7
votes
5 answers
Laravel 9 - Vite is not bundling my images even if I declared the entry point
I am using Laravel 9.27.0
I am trying to reference an image directly on my master.blade.php located on resources/views. This image is being used as the favicon for the site I am working on. According to the documentation, I should be able to…

Jheems
- 300
- 1
- 4
- 11
6
votes
1 answer
Laravel 9 with Vite, mixing .css and .js files into one?
How do you deal with mixing multiple .css and .js files into one which laravel mix used to do so far.
The new Laravel 9 comes with Vite.js installed and laravel mix removed. As the main function for which we mostly used laravel mix was to mix the…

MorganFreeFarm
- 3,811
- 8
- 23
- 46
6
votes
3 answers
How to use DataTables with Laravel Vite?
I'm having trouble adding DataTables to my new Laravel 9.21 instance. But I'm getting an error in the console. What am I missing?
Uncaught TypeError: $(...).DataTable is not a function
bootstrap.js
import jquery from 'jquery';
window.jQuery =…

Karl Hill
- 12,937
- 5
- 58
- 95
6
votes
1 answer
Is the " npm run watch" property already in Laravel Vite?
Is the "watch" property already in vitejs?
I'm starting a new project using Laravel Framework 9.19.0 in which vite is auto-mounted.
I've added alpine.js for the front. I've tried to run
npm run watch
This is my package.json file
{
"private":…

Arotiana RANDRIANASOLO
- 111
- 1
- 8
5
votes
1 answer
Laravel SSR Vue config for Vite, ssr.js file?
How can I make SSR to work for my Laravel project with Vite?
export default defineConfig({
plugins: [
laravel({
input: ["resources/css/app.css", "resources/js/app.js"],
ssr: "resources/js/ssr.js",
…

user1469734
- 851
- 14
- 50
- 81
5
votes
1 answer
Laravel-Vite compile scss and js to seperate public/asset folder
So before, with laravel MIX, in the webpack.mix.js file, you can write
mix.js('resources/js/app.js', 'public/js')
.js('resources/js/header.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.sass('resources/sass/main.scss',…

Lourd Nathaniel Gonzalez
- 111
- 8
4
votes
3 answers
Default Laravel + Vite configuration throws WebSocket connection to failed:
So Laravel decided to innovate once again and fix what was not broken, so Mix is gone and now default asset bundling goes with Vite.
I'm following the absolute default in their documentation to a bunch of front-end bugs and finally only several…

OurBG
- 507
- 1
- 8
- 22
4
votes
0 answers
How to reference images which are created from laravel-vite build into the blade template
I'm in the learning stage of vite and replacing the laravel-mix with vite. Now i'm facing a situation that how can I reference images in laravel blades which are passed as entry point in the vite-config?
plugins: [
vue(),
laravel({
…

Pranab V V
- 1,386
- 5
- 27
- 53
3
votes
0 answers
404 on assets when using Laravel Vite + Sail
I wanted to try out Sail on my Windows machine, however, after installing Breeze on a brand new installation of Laravel and running sail npm run dev I received a 404 in the browser for http://localhost/css/app.css and http://localhost/js/app.js when…

Lewis L
- 31
- 2
3
votes
2 answers
Unable to Install @vitejs/plugin-vue inside Laravel project
I created a fresh Laravel project. And to use Vue JS I tried installing this package,
@vitejs/plugin-vue
But this throws me a set of errors,
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code…

Mishen Thakshana
- 1,050
- 1
- 14
- 38
2
votes
2 answers
Vite only importing some of the files in a folder
I'm migrating my Laravel app to Vite, and one of the things I wanted to do is copy over my images assets to the public folder. Following the Laravel doc https://laravel.com/docs/9.x/vite#blade-processing-static-assets I added…

Jeremy Belolo
- 4,319
- 6
- 44
- 88
2
votes
1 answer
How can I fix Uncaught (in promise) ReferenceError: require is not defined with Vite?
I downloaded this template locally (https://github.com/sinan-aydogan/tailadmin-laravel) and then uploaded it on Bitbucket to be converted from Mix to Vite using Laravel Shift. However, when I ran it, I got the following.
Failed to load resource:…

Dev Related Cube
- 25
- 1
- 5
2
votes
1 answer
Laravel Vite Can't change base url for ping pong
I am using my own nginx server to run laravel application. The problem that I cannot change base_url/__vite_ping. It tries to request https://server.test/__vite_ping rather than https://localhost:3000/__vite_ping. Here is my vite.config.js
import…

Andrius Solopovas
- 967
- 11
- 41