Parcel 2 running in a standard Node.js Docker container does not detect changes in files on a mounted volume when they are updated from the host and thus does not rebulid the project it is serving. This prevents us from effectively using Parcel 2 in development.
This repo offers a is a minimal-setup reproduction of the issue to help debug and assess possible workarounds or fixes.
To see the problem:
Requirement: Docker
- Run
docker compose up --build
- Edit a file in
src
directory from the host machine- Ensure you're not using an editor that uses "safe write" (reference)
- Observe that Parcel 2 does not see the file change and does not rebuild the project
Note that Parcel 2's server will see the file change and will successfully rebuild if you touch
the file from within the container itself. To see this, make the change as above and notice that Parcel doesn't rebuild, then run:
docker exec $(docker ps --filter "name=parcel2" --quiet) touch /app/src/animals.js
and note that Parcel now immediately rebuilds the project successfully.
This has been tested on Mac OS 10.15.7 with Docker Desktop 4.1.1 (69879)