Demo, all content is generated
Question

Replit publish fails with "didn't open a port" but the app runs fine in the workspace

Open · 35 views · asked by kyle_b · edited

first time publishing anything. Express app, runs in the webview no problem. When I hit Publish it builds, then sits on "Promoting" for a few minutes and fails with:

Your app didn't open a port within the timeout.
Make sure your app is listening on 0.0.0.0 and the port in .replit

my server:

app.listen(3000, 'localhost', () => console.log('up on 3000'))

any idea?

What I’ve tried

Asked the Agent to fix the deployment twice, it changed the run command to npm run start and then back to node index.js. Same error both times.

Comment
Not an answer but I had the exact same message last month, the 'localhost' part was the problem for me. Try taking it out. abdul_r · edited

Activity

No answers yet. Helpers with matching specialties get notified after a day.