Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

au run --watch doesn't detect file changes in some cases #787

Closed
Gimly opened this issue Nov 13, 2017 · 5 comments
Closed

au run --watch doesn't detect file changes in some cases #787

Gimly opened this issue Nov 13, 2017 · 5 comments

Comments

@Gimly
Copy link

Gimly commented Nov 13, 2017

I'm submitting a bug report

  • Library Version:
    Aurelia cli 0.32.0

Please tell us about your environment:

  • Operating System:
    Linux (Debian Jessie inside Docker container), Windows 10 (Docker Host)

  • Node Version:
    8.9.1

  • NPM Version:
    5.5.1
  • Browser:
    all

  • Language:
    TypeScript 2.6

  • Loader/bundler:
    RequireJS

Current behavior:
I'm testing Aurelia, and since I didn't want to install too much things directly on my machine, I decided to try to create a Docker image for development with Aurelia. I based it upon Debian Jessie and installed all the necessary dependencies to get Aurelia CLI working (Git, NodeJs, NPM).

I have linked the ports (9000 and 3001) of the Docker image to the same ports on my Windows 10 host, and created a volume in the Docker image that is linked to a local folder in the host. I then created a new Aurelia project using au new inside of the volume used by the Docker image. This way, I can access the app code from my local machine as well as from the Docker image.

When I start the app with au run --env dev --watch, it builds and I can access it fine by going to localhost:9000 from my local machine. If I modify a file directly from the Docker image (using vi for example), it detects that the file changed and triggers a rebuild, and I see the changes in the page directly.

However, if I change the files from the host, the watcher doesn't see that a file has changed and doesn't trigger the build. I can see that the file has changed on the Docker image, and that the "modified date" was updated, but the watcher doesn't see it. If I simply touch filename, then the watcher triggers a rebuilds and serves the new file.

  • What is the expected behavior?

I would expect the watcher to detect the file change, even if it's coming from the host.

@JeroenVinke
Copy link
Collaborator

Could you provide a repository that has this setup? That would make it easier to start debugging

@JeroenVinke JeroenVinke added the bug label Dec 4, 2017
@ccrd
Copy link

ccrd commented Dec 12, 2017

I had a similar issue observing file changes in a samba mount. Adding usePolling to gulp.watch configuration solved it.

...
gulp.watch(project.transpiler.source, { 
        usePolling: true // Polling enables file watching on samba shares  
}, refresh).on('change', onChange);  
...

@3cp
Copy link
Member

3cp commented Jan 12, 2018

This is likely a limitation from chokidar (which gulp-watch uses) instead of aurelia-cli.

paulmillr/chokidar#242

The solution is similar to @ccrd suggested, just use polling.

@Alexander-Taran
Copy link
Contributor

documentation
help_needed

edge case with watching not real file system

JeroenVinke added a commit to JeroenVinke/cli that referenced this issue Mar 19, 2018
@JeroenVinke
Copy link
Collaborator

added this to #787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants