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

t9dev's avatar
Level 2

Vite error ( not showing CSS styles)

I have hosted an app to a Server, and everything is fine except that the Vite file causes two errors on my Browser.

Failed to load resource: net::ERR_CONNECTION_REFUSED 5173/@vite/client:1 ..... 5173/resources/js/app.js:1 layouts/app

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

vite.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
    ],
});
0 likes
13 replies
Sinnbeck's avatar

Check if you have a file named hot in the public directory. Delete it

1 like
Sinnbeck's avatar

@t9dev you cannot run dev in production. As the name implies it's for development. Stop it and it should work

t9dev's avatar
Level 2

@Sinnbeck , exactly, I tried to remove it using "rm" but it says file doesn't exists.

t9dev's avatar
Level 2

@Sinnbeck , and how to run the server? It only shows the when I run the command run dev.

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You vite helper is wrong. It should be an array

@vite(['resources/js/app.js','resources/css/app.css'] )
Sinnbeck's avatar

You don't run the server. Try fixing vite and we can see if it works

Please or to participate in this conversation.