parcel-bundler / watcher

👀 A native C++ Node module for querying and subscribing to filesystem events
MIT License
642 stars 40 forks source link

Watcher not reporting events when used in docker. #148

Open azhar1038 opened 1 year ago

azhar1038 commented 1 year ago

I am using Windows 11 and trying to use @parcel/watcher in a docker container. I have mounted my files so that if I change anything locally it triggers the watcher but it is not working. Strangely if I change something in a mounted file through Docker Desktop, a delete and create events are fired.

Here is my Dockerfile

FROM node:alpine
WORKDIR /app
COPY ./package*.json /app
RUN npm install
COPY . .
CMD ["npm", "start"]

Here is my docker-compose.yml

version: '3.8'
services:
  parcel:
    build: .
    volumes:
      - .:/app
      - nodeModules:/app/node_modules

volumes:
  nodeModules:

Same issue also happens with chokidar but chokidar has an option usePolling that uses polling to provide a workaround to this issue.

azhar1038 commented 1 year ago

Reason for this issue seems to be related to [WSL2] File changes made by Windows apps on Windows filesystem don't trigger notifications for Linux apps

OneHoopyFrood commented 3 months ago

I believe I am also experiancing this issue