Skip to content

🐛 Bug Report: Vite's HMR update is not working in docker compose on windows #2456

@mustafa-sayyed

Description

@mustafa-sayyed

📜 Description

When running the frontend with docker-compose-local.yaml on Windows, changes inside src are reflected in the mounted file system, but Vite does not restart or hot-reload. The dev server stays running and only picks up changes after a manual container restart

This is happening because the file system change events are not getting delivered from Windows to the Linux container
to Chokidar ( vite relies on chokidar for hmr update )

👟 Reproduction steps

  1. compose up using docker-compose-local.yaml
  2. Change something in the frontend src folder
  3. Observe logs of Docker Compose

👍 Expected behavior

Editing any file in the src should trigger Vite HMR immediately
No manual container restart should be required

👎 Actual Behavior with Screenshots

hmrDocsgpt.mp4

This video shows that the changes are reflected in the mounted volume, but the Vite server is getting file change events, resulting in no HMR updates

💻 Operating system

Windows

What browsers are you seeing the problem on?

Chrome

🤖 What development environment are you experiencing this bug on?

Docker

🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

No response

📃 Provide any additional context for the Bug.

No response

📖 Relevant log output

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🔗 Are you willing to submit PR?

Yes, I am willing to submit a PR!

🧑‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions