Exception with livereload when using flag "UseModernBuildSystem"

To build ionic with the new xCode 10 one must use the build flag UseModernBuildSystem=0
As multiple persons have expressed here: https://github.com/apache/cordova-ios/issues/407#issuecomment-424014105 This build flag causes issues with livereload for Android and iOS.
Basically the terminal is initializing the livereload session without actually completing it. Sample output:

yarn run v1.6.0
$ ionic cordova run ios --livereload -- --buildFlag="-UseModernBuildSystem=0"
> npm run ionic:serve -- --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser --iscordovaserve --platform ios --target cordova --buildFlag=-UseModernBuildSystem=0
[npm] > komed-frontend@0.0.14 ionic:serve /Users/borntsch/Documents/komed/komed-frontend
[npm] > ionic serve --consolelogs --no-open "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--nobrowser" "--iscordovaserve" "--platform" "ios" "--target" "cordova" "--buildFlag=-UseModernBuildSystem=0"
[npm] [WARN] The --nobrowser option has been deprecated. Please use --no-open.
[npm] > npm run ionic:serve -- --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser --platform ios
[npm] [npm] > komed-frontend@0.0.14 ionic:serve /Users/borntsch/Documents/komed/komed-frontend
[npm] [npm] > ionic serve --consolelogs --no-open "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--consolelogs" "--nobrowser" "--platform" "ios"
[npm] [npm] [WARN] The --nobrowser option has been deprecated. Please use --no-open.
[npm] [npm] > npm run ionic:serve -- --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser --platform ios
[npm] [npm] [npm] > komed-frontend@0.0.14 ionic:serve /Users/borntsch/Documents/komed/komed-frontend
[npm] [npm] [npm] > ionic serve --consolelogs --no-open "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--consolelogs" "--nobrowser" "--platform" "ios"
[npm] [npm] [npm] [WARN] The --nobrowser option has been deprecated. Please use --no-open.
[npm] [npm] [npm] > npm run ionic:serve -- --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --consolelogs --nobrowser --platform ios
[npm] [npm] [npm] [npm] > komed-frontend@0.0.14 ionic:serve /Users/borntsch/Documents/komed/komed-frontend
[npm] [npm] [npm] [npm] > ionic serve --consolelogs --no-open "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729" "--dev-logger-port" "53703" "--consolelogs" "--nobrowser" "--platform" "ios"
[INFO] Waiting for connectivity with npm...

How can this be fixed?

What happens when you add a build.json (see post below) and remove the buildFlag from the command-line?

Hi @MattE
Thanks for your reply. While I was researching this I noticed that the exception actually also happens if I run ionic cordova run android --livereload. So probably it’s not an issue with the modern build system for iOS.

So it it maybe rather a bug with ionic CLI v4.1.2? Because I recently upgraded from v3 and my colleagues still using v3 do not have this bug…

I had the same issue as you, except I’m using WSL on W10. Downgrading to ionic 3.20.0 fixed it for me.