Ionic-app-scripts: (v2) ionic serve --watch-poll for webpack is needed

Created on 15 Mar 2017  路  6Comments  路  Source: ionic-team/ionic-app-scripts

What version of the CLI are you using? Output of ionic --version

2.2.1

Short description of the problem:

Using ionic on a NFS Vagrant virtual machine

759

driftyco/ionic-app-lib#73

What behavior are you expecting?

That I can change how polling works, when using ionic serve

Steps to reproduce:

  1. Create a Vagrant machine
  2. Enable sharing through SMB
  3. Create an ionic environment
  4. Start the project and change a file on the host system

Post the output of ionic info below please

ionic info

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v6.9.4
Xcode version: Not installed

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
I tried to apply the patch from driftyco/ionic-app-lib#73 but the structure of the ionic-app-lib has completly changed and I am unable to find the proper places to change.

I am also running several plain Angular 2 projects and there polling and recompiling on the fly works in this setup.

@tomsun Did you get it working in any current versions? Would be super helpful to solve this problem

Most helpful comment

since ionic-app-scripts uses https://github.com/paulmillr/chokidar under the hood, we can use polling in live reload by setting this environment variable:

CHOKIDAR_USEPOLLING=1

I hope this helps someone.

All 6 comments

driftyco/ionic-cli#1993

suffering from exactly the same problem. I spent a full day now to try and find out what is missing in my vagrant setup and why the watcher doesn't detect anything and I have no fix at all.
This works perfectly on a native machine but not in a virtualized one.

I also used gulp and webpack with several angular and react projects and never came across this issue. By the way this problem is also occuring when you are using the standard vboxfs so it's not only happening with NFS.

@flashabteilung For now I got a work-around by getting https://github.com/adrienkohlbecker/vagrant-fsnotify to work. Which works with windows as well. Hope this helps you out as well.

Wow, tested it immediatly and it works perfectly and fast, too!
Thanks for that, I will integrate this into my setup.

The watch file in vagrant (VM) does not work. Also, the https://github.com/adrienkohlbecker/vagrant-fsnotify does not work properly after 5-10 min the ionic serve stuck.

since ionic-app-scripts uses https://github.com/paulmillr/chokidar under the hood, we can use polling in live reload by setting this environment variable:

CHOKIDAR_USEPOLLING=1

I hope this helps someone.

Was this page helpful?
0 / 5 - 0 ratings