Deployment error :

Hi everybody, i try to deploy my project (is not finish yet but i just want to test something) and i can’t deploy it. I’ve got this error : error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on and a staff member will take a look. My project work fine in the dev zone when i click on run. I don’t have error in the logs.

Can somebody help me ? Thanks a lot.

Hi @vivolts74 , welcome to the forums!
Could you send the logs of the deployment anyqay?
Also, what deployment method are you using?

1 Like

Hi, thank you for helping me : )
I use autoscale deploy, this is my logs :

Instead of listening to localhost, could you try

i try, didn’t work too. I don’t understand because i use same configuration et same file from a other project who work,i just add new things in the client files

Hi @vivolts74 , could you check the Networking tab under Tools and check if the ports are properly configured?

yes of course !

That would seem to be your issue, your repl is listening on 8080, but it’s forwarding 80.

Try modifying the .replit file to use the correct ports.


I always have the same error …

What is your program set to listen on? (Assuming this is express, what’s the app.listen line?)

But i think my problem is from html file, because if u put an other one, deploy works

Can i give you acces to the repl ? It will be easier for you ? Thank a lot

One thing I notice from your screenshot here, is that you have code after the listen call. Code after that line shouldn’t execute, since the listen should block it from going farther.

You could, but I can’t guarantee that it’d make it easier for me.

Looking over your code, I don’t see why the deployment logs said it was listening on 8080, when your code says to listen on 80. Regardless, could you try changing:

const port = 80;


const port = 8080;

and your .replit port section from:

localPort = 80
externalPort = 3000

localPort = 8080
externalPort = 80

to just

localPort = 8080
externalPort = 80

As a final note, this is the only part of your code that runs:

Since the rest of it is after that http.listen line.

That doesn’t work, jut if indelete html file, it works so, the problem come from my html file i guess ?

1 Like

Hi, FYI, I found the source of the problem. As I had clearly identified, the problem came from the html file, which was in fact much too large. I dynamically add part of my html which was not useful to me at the beginning via javascript and no more problems. Thanks in any case for trying to help me out :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.