Express build error

Hi Guys, So i’m deploying an blogging website using vercel. The languages used are express.js, node.js, and database mongoDB
I deployed it to a docker container and it’s working fine. It is 400mb large on docker (Which is not good i know).
When i try to deploy it using vercel hobby-account it get stuck. Everything work fine vercel assign a port to it database got connected but then after 35-40 minutes it stops and there are no warnings, no errors still not deploying.
So, what’s the issue and how to resolve it?

Hey @cybercodeross. We have a guide to help you get Express.js apps working with Vercel’s serverless environment: Using Express.js with Vercel

Based on the error happening during the build, I’m curious to know what the build command is. Can you share the Build and Development Settings used for this project?

2 Likes

im using “npm install” for installing packages like nodemon and other
moreover to build im using “npm run dev”.

Using npm install is standard and it appears to succeed based on the build log you shared. I don’t know what the repo’s dev script contains, but it looks like the problem is happening because a local development command is being run instead of a normal build. I wouldn’t expect to see App listening on port 3000 for a serverless deployment.

I recommend following the Express.js with Vercel guide for project setup. It includes tips about adapting Express to serverless environments.

There’s also a couple of example projects that might help you.

1 Like

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