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

Live Reload Not Working #18

Closed
ajainvivek opened this issue Jan 7, 2017 · 10 comments
Closed

Live Reload Not Working #18

ajainvivek opened this issue Jan 7, 2017 · 10 comments

Comments

@ajainvivek
Copy link

Hi,

Live Reload not working on MacOs

Volume mounting is working fine and the changes are getting copied over.

@koistya
Copy link
Member

koistya commented Jan 8, 2017

Hi, Ajain. I'm unable to reproduce this issue. Are you running the latest version of Docker for Mac?

@bwoodlt
Copy link
Contributor

bwoodlt commented Jan 8, 2017

Hi. Seems to work for me. Not having issues with Live Reload on MacOSx.

@koistya
Copy link
Member

koistya commented Jan 8, 2017

@ajainvivek ah, maybe you expecting it to reload the browser? But this project doesn't have any front-end code, nothing to reload in a browser, it just restarts Node.js app server once code changes are detected. The "Welcome, Guest! Login" message on the homepage is just a testing page, for demonstration purposes. This project exposes only two endpoints - /graphql and /login/* which can be added to a front-end app via a reverse proxy (Nginx, IIS etc.).

@ajainvivek
Copy link
Author

ajainvivek commented Jan 8, 2017

I am running Docker version 1.12.2, build bb80604 I can see the files getting changed over the docker container but the node server doesn't restart. I have made changes to users.js.

watch mode is also set to true.

watcher.on('all', (event, src) => {
    console.log('file changed......');
    // Reload the app if .env or package.json file has changed (in watch mode)
    if (src === '.env' || src === 'package.json' || src === 'yarn.lock') {
      if (ready && onComplete) onComplete();
      return;
    }

chokidar doesn't capture file changes event after build. the log doesn't print after build

I am testing the changes on GraphiQL

@koistya
Copy link
Member

koistya commented Jan 8, 2017

Ajain, I'm not sure what causes this issue yet, but would you consider upgrading Docker for Mac to 1.12.5? Maybe this will fix the issue. At least this is the simplest thing to try first.

@ajainvivek
Copy link
Author

ajainvivek commented Jan 8, 2017

I have also upgraded docker on the docker-machine instance but the file changes where never triggered.

After enabling polling. It works.

usePolling: true

I have other projects which uses nodemon which requires legacyWatch enabled to make it work on docker.

I am curious to know. How to make it work?

@koistya
Copy link
Member

koistya commented Jan 21, 2017

@ajainvivek it should work without setting usePolling: true. Can you check docker --version?

@ajainvivek
Copy link
Author

Sorry for the late response the docker version .. I was running was Docker version 1.12.2, build bb80604

@koistya
Copy link
Member

koistya commented Mar 16, 2017

@ajainvivek I'm still unable to reproduce the issue. Maybe you can try the latest Docker version - v17.03.0 Community Edition. Closing for now, feel free to re-open if this issue still exists.

@koistya koistya closed this as completed Mar 20, 2017
@koistya
Copy link
Member

koistya commented Apr 4, 2017

In order to make the file watcher use "polling", create docker-compose.override.yml file in the root directory of your project with the following content:

version: '3'
services:
  api:
    environment:
      - CHOKIDAR_USEPOLLING=true

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

No branches or pull requests

3 participants