Ionic CLI 6.x [INFO] Waiting for connectivity with vue-cli-service... and 100% CPU

Viewed 80

I'm using ionic 6 in a new Vue 3 project and when I run npx ionic serve it runs the build and serves the project correctly (also correctly rebuilds when files are changes). But it logs this info message and is running a processor at 100% apparently in a spin lock.

> npx ionic serve                                                                                                                                      main [⇡] 
> vue-cli-service serve
[vue-cli-service]  INFO  Starting development server...
[38%] building (23/196 modules)
Build finished at 11:42:48 by 0.000s

[vue-cli-service]   App running at:
[vue-cli-service]   - Local:   http://localhost:8100/ 
[vue-cli-service]   - Network: http://192.168.50.45:8100/
[vue-cli-service]   Note that the development build is not optimized.
[vue-cli-service]   To create a production build, run npm run build.
No issues found.
[INFO] Waiting for connectivity with vue-cli-service...
[INFO] Waiting for connectivity with vue-cli-service...
[repeats until process is killed]

I believe I am on the latest Ionic and Vue versions: package.json:

{
  "name": "audio-flashcards-vue",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "test:e2e": "vue-cli-service test:e2e",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@capacitor/app": "1.1.1",
    "@capacitor/core": "3.6.0",
    "@capacitor/haptics": "1.1.4",
    "@capacitor/keyboard": "1.2.3",
    "@capacitor/status-bar": "1.0.8",
    "@ionic/vue": "^6.0.0",
    "@ionic/vue-router": "^6.0.0",
    "@vueuse/core": "^8.9.3",
    "@vueuse/router": "^8.9.3",
    "core-js": "^3.6.5",
    "pinia": "^2.0.16",
    "pinia-plugin-persistedstate": "^1.6.3",
    "vue": "^3.2.21",
    "vue-router": "^4.1.2"
  },
  "devDependencies": {
    "@capacitor/cli": "3.6.0",
    "@types/jest": "^27.0.2",
    "@typescript-eslint/eslint-plugin": "^5.6.0",
    "@typescript-eslint/parser": "^5.6.0",
    "@vue/cli-plugin-babel": "~5.0.0-rc.1",
    "@vue/cli-plugin-e2e-cypress": "~5.0.0-rc.1",
    "@vue/cli-plugin-eslint": "~5.0.0-rc.1",
    "@vue/cli-plugin-router": "~5.0.0-rc.1",
    "@vue/cli-plugin-typescript": "~5.0.0-rc.1",
    "@vue/cli-plugin-unit-jest": "~5.0.0-rc.1",
    "@vue/cli-service": "~5.0.0-rc.1",
    "@vue/eslint-config-typescript": "^9.1.0",
    "@vue/test-utils": "^2.0.0-rc.16",
    "@vue/vue3-jest": "^27.0.0-alpha.3",
    "babel-jest": "^27.3.1",
    "cypress": "^8.7.0",
    "eslint": "^8.4.1",
    "eslint-plugin-vue": "^8.2.0",
    "jest": "^27.3.1",
    "ts-jest": "^27.0.7",
    "typescript": "^4.3.5"
  },
  "description": "An Ionic project"
}
> npx ionic info                                                                                                                                      

   Ionic CLI       : 6.20.1 (/Users/saschwarz/.nvm/versions/node/v18.3.0/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 6.1.13

Capacitor:

   Capacitor CLI      : 3.6.0
   @capacitor/android : not installed
   @capacitor/core    : 3.6.0
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 1.6.0

System:

   NodeJS : v18.3.0 (/Users/saschwarz/.nvm/versions/node/v18.3.0/bin/node)
   npm    : 8.11.0
   OS     : macOS Monterey

Any ideas on how to resolve this?

1 Answers

Try adding the following entry in your "capacitor.config.json" (or "capacitor.config.ts"):

"server" : {
"url" : "http://localhost:8100/" // Address of the server running locally
},

It worked for me. This issue only showed up when I tried to run my Ionic project in an MacOS system. Previously in an Ubuntu setup was working fine.

Related