Why does my Express client hang forever?
Your handler did the work but forgot to send a response. Every handler must call res.send, res.json, or res.end. Better: use a wrapper that catches errors and sends a response automatically.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Common Express Server Setup Mistakes (and How to Fix Them)
Body parser missing or after routes, no error handler, hardcoded port, CORS misconfigured, .env not loaded, routers not mounted, handlers that forget to respond, misuse of next, sync heavy work in handlers, and console.log in production.
Because express.json() was not added or was added after the routes that read req.body. Add app.use(express.json()) before any route that needs to parse JSON request bodies.
Routers need to be mounted in app.js with app.use('/path', router). Creating a router in routes/auth.js is not enough; you must attach it to the Express app.
Still have questions?
Browse all our FAQs or reach out to our support team
