Lovable deployment

Vite Hot Module Replacement (HMR) Connection Fails

Vite dev server starts but HMR connection fails with 'WebSocket connection failed' or 'net::ERR_CONNECTION_REFUSED'. Changes require manual page refresh instead of hot reload. Development experience is slow.

HMR requires WebSocket connection from browser to dev server. Network configuration or firewall can block the connection.

Error Messages You Might See

WebSocket connection failed net::ERR_CONNECTION_REFUSED HMR connection timed out
WebSocket connection failednet::ERR_CONNECTION_REFUSEDHMR connection timed out

Common Causes

  1. Dev server not on correct host/port
  2. WebSocket connection blocked by firewall/proxy
  3. HMR host not configured for remote dev
  4. HTTPS in production with HTTP dev server mismatch
  5. Port not exposed in container/VM environment

How to Fix It

Configure HMR in vite.config.js for remote dev:

export default {
  server: {
    hmr: {
      host: 'localhost',
      port: 5173,
      protocol: 'ws'
    }
  }
}

For remote development (Docker, VM):

hmr: {
  host: 'your-dev-server.com',
  port: 443,
  protocol: 'wss'
}

Real developers can help you.

prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Alvin Voo Alvin Voo I’ve watched the tech landscape evolve over the last decade—from the structured days of Java Server Pages to the current "wild west" of Agentic-driven development. While AI can "vibe" a frontend into existence, I specialize in the architecture that keeps it from collapsing. My expertise lies in the critical backend infrastructure: the parts that must be fast, secure, and scalable. I thrive on high-pressure environments, such as when I had only three weeks to architect and launch an Ethereum redemption system with minimal prior crypto knowledge, turning it into a major revenue stream. What I bring to your project: Forensic Debugging: I don't just "patch" bugs; I use tools like Datadog and Explain Analyzers to map out bottlenecks and resolve root causes—like significantly reducing memory usage by optimizing complex DB joins. Full-Stack Context: Deep experience in Node.js and React, ensuring backends play perfectly with mobile and web teams. Sanity in the Age of AI: I bridge the gap between "best practices" and modern speed, ensuring your project isn't just built fast, but built to last. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I debug HMR issues?

Check browser DevTools Network tab for WebSocket connection. Look for connection to /__vite_ping endpoint.

What port does HMR use?

Same as dev server by default (usually 5173). Can be configured separately for remote development.

Related Lovable Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help