[fixed] Larvel Vite localhost To

APP_URL: http://localhost not working

Answering for:

Vite npm run dev comming http://localhost not running in Laravel

Vite not running in it’s running http://localhost

How to run vite in not http://localhost

auto reload laravel with vite without refresh

In laravel 10 bydefault has vite installed, it’s really good but if you run npm run dev then it’s come APP_URL: http://localhost and if you click on it then it not open, here I’m showing you Larvel Vite localhost To auto load for your forntend.

It’s the simple process to run easily.

It’s showing you the APP_URL: http://localhost so you can change it form env file.

Go to your env file and change it http://localhost to



then save it.

It’s works for you.

Note. you need to include the vite css file and js file in the head of you html.

@vite(['resources/css/app.css', 'resources/js/app.js'])
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="{{ csrf_token() }}">

        <title>{{ str_replace('_', ' ', config('app.name', 'Laravel'))  }}</title>

        <!-- Fonts -->
        <link rel="preconnect" href="https://fonts.bunny.net">
        <link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />

        <!-- Scripts -->
        @vite(['resources/css/app.css', 'resources/js/app.js'])
  <body class="font-sans antialiased">
        <div class="min-h-screen bg-gray-100">

            <!-- Page Heading -->
            @if (isset($header))
                <header class="bg-white shadow">
                    <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                        {{ $header }}

            <!-- Page Content -->
                {{ $slot }}


Leave a Reply