Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

waltergrimmvie's avatar

Laravel Valet help

I have a Laravel project using Vue and Inertia(Jetstream oriented). I am serving the application through Laravel Valet on Windows machine. When I run npm run dev Vite builds the assets, but when I go to the browser I get a blank page.

When I open up Chrome devtools, I see this error:

GET https://blog.test:5173/@vite/client net::ERR_CONNECTION_REFUSED
blog.test/:20 
GET https://blog.test:5173/resources/js/app.js net::ERR_CONNECTION_REFUSED
blog.test/:20
GET https://blog.test:5173/resources/js/Pages/Welcome.vue net::ERR_CONNECTION_REFUSED

I only can only see my code updates(Vue components) after running "npm run build", but I need "npm run dev" working to see real time refresh. (or don't want to delete hot file in /public directory) Everything else seems working correct except above issue - "npm run dev" is not working.

VITE v5.1.6  ready in 388 ms

 ➜  Local:   https://localhost:5173/
 ➜  Network: use --host to expose
 ➜  press h + enter to show help

 LARAVEL v10.42.0  plugin v1.0.2

 ➜  APP_URL: https://blog.test

I've already secured the blog.test domain using "valet secure blog" command. Also, updated /etc/hosts file: domain blog.test is pointing to 127.0.0.1.

Here is my current vite.config.js file.

import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";

export default defineConfig({
    server: {
        https: true,
        hmr: {
            host: "blog.test",
        },
    },
    plugins: [
        laravel({
            input: "resources/js/app.js",
            refresh: true,
        }),
        vue({
            template: {
                transformAssetUrls: {
                    base: null,
                    includeAbsolute: false,
                },
            },
        }),
    ],
});

Please let me know how to fix the error.

0 likes
3 replies
coni's avatar

Please try add this to your vite.config.js:

export default defineConfig({
    server: {
        hmr: {
            host: 'localhost',
        },
    },
});
waltergrimmvie's avatar

@coni , I've tried that but couldn't get it working. I get blank white screen on the browser when I hit https://blog.test and following is what I see on the console tab of developer tool.

GET https://localhost:5173/@vite/client net::ERR_CONNECTION_REFUSED
blog.test/:20         
        
GET https://localhost:5173/resources/js/app.js net::ERR_CONNECTION_REFUSED 
blog.test/:20 
        
GET https://localhost:5173/resources/js/Pages/Welcome.vue net::ERR_CONNECTION_REFUSED
blog.test/:20 

Please or to participate in this conversation.