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

Givar's avatar
Level 1

net::ERR_connection_refused when deploying laravel 9 app with laravel forge

Hello everybody,

I'm facing an issue since this this morning and i cannot solve it in any way, I've tried to destroy and recreate several times my server, tried to change configurations but i cannot get it to work the same.

I'm deploying via laravel forge an app created with laravel 9, the app load at the domain but there's no way that my css/js are loaded.

I'm getting in my console the following errors :

GET http://127.0.0.1:5174/resources/css/app.css net::ERR_CONNECTION_REFUSED
resellhotels.com/:26          GET http://127.0.0.1:5174/@vite/client net::ERR_CONNECTION_REFUSED
resellhotels.com/:26          GET http://127.0.0.1:5174/resources/js/app.js net::ERR_CONNECTION_REFUSED

You can see it at resellhotels.com . I've tried to follow several online guides but the error is still there; I think this issue is caused by VITE.

My .gitignore looks like this :

/node_modules
!/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
readme.md
server.md

and my vite.config.js

import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import path from "path";

export default defineConfig({
    plugins: [
        laravel({
            input: ["resources/css/app.css", "resources/js/app.js"],
            refresh: true,
        }),
    ],
    resolve: {
        alias: {
            "~bootstrap": path.resolve(__dirname, "node_modules/bootstrap"),
        },
    },
    server: {
        watch: {
            usePolling: true,
            host:'0.0.0.0',
        },
    },
});

Is there anybody who can help me to solve this issue? Thank you very much.

0 likes
23 replies
Sinnbeck's avatar

Delete the file named hot inside the public directory. Seems you accidentally added it to the deployment. It's made when running the dev server

6 likes
Givar's avatar
Level 1

@Sinnbeck hello and thank you for your prompt reply.

I just tried to upload and deploy it again but nothing has changed and this is still not working.

Sinnbeck's avatar

@Givar did you delete the file or is it still there? Did the error change?

Givar's avatar
Level 1

@Sinnbeck

The file has been deleted as you suggested above, here's my public folder :

Public
-Build
-Img
-storage
.htaccess
favicon.ico
index.php
robots.txt

After deleting the file, i've launched npm run build but, as you can see at the url resellhotels.com the error is still there and nothing has changed unfortunately.

Sinnbeck's avatar

@Givar the file is still there. Did you accidentally run npm run dev? That creates the file

resellhotels.com/hot

1 like
Givar's avatar
Level 1

@Sinnbeck wait, I can't see it from my folders. Yes, I have npm run dev running behind. Is this the cause?

Sinnbeck's avatar

@Givar as the name implies it's for development, not production. You run npm run build on deploy only, never npm run dev

Hope that makes sense

Givar's avatar
Level 1

@Sinnbeck ok I understood but it seems that the issue is still there.

I have done the following steps now:

  • Stopped npm run dev -Deleted the .hot file from public folder -pushed the changes to git which runs the deploy

But the error is still there and the .hot file too. I'm really not understanding what's wrong here. I've deployed several laravel/vite web apps but never had this issue.

Can you still see the .hot file?

Givar's avatar
Level 1

@Sinnbeck I just had a look at gitLab repository and no, it's not listed in the public folder in the git repository. From where is it coming from ?

Sinnbeck's avatar

@Givar it is created whenever you run npm run dev. Try it out locally

Givar's avatar
Level 1

@Sinnbeck yes i know. I mean i know where it's coming from in development, but now, in prod, After i removed it and not running anymore npm run dev, why Is It still there? 😅😅😅

Sinnbeck's avatar

If you just delete it and do nothing else? No redeploy

Givar's avatar
Level 1

@Sinnbeck remaining the same. the error is still there. What can you suggest me to do? Thank you

newbie360's avatar

@Givar you are delete the file in the repo, not on the web server, i forgot in Forge has something called Auto-commit?

1 like
Sinnbeck's avatar

@newbie360 maybe ask forge support how it is able to add the file automatically after delete?

Or maybe try restarting the server in case the dev command is running in the background somehow

newbie360's avatar

@Sinnbeck i can't remember the name in Forge, something like auto-commit ? if make any changes to repo, it will auto make change to the live server at the same time, actually in GitHub has this setting

OP may be try SSH to live server, check the file is exists or not

1 like
Sinnbeck's avatar

@newbie360 never used forge, so I can't say (I use ploi.io). But it's a good lead ;)

1 like
Givar's avatar
Givar
OP
Best Answer
Level 1

@Sinnbeck sorted It out. I don't know how, after each deploy the server was generating a new hot file.

I noticed it when i SSH into the server to manually delete the hot file.

Tried to restart and did not solve the issue. Had to destroy and recreate It.

danichangt's avatar

@Sinnbeck I had the same issue, but npn run build works for me. My app now is deployed nice. Thank you.

Please or to participate in this conversation.