The CPU usage by Node goes well over 100% when I run my npm script, which is using vue-cli-service serve
.
How can I debug this issue?
I'm working on a Mac, Node installed through nvm. Node version: 10.16, npm version: 6.9
The CPU usage by Node goes well over 100% when I run my npm script, which is using vue-cli-service serve
.
How can I debug this issue?
I'm working on a Mac, Node installed through nvm. Node version: 10.16, npm version: 6.9
The problem was caused by the polling option.
Removing poll: true
from the watchOptions
in the webpack config - fixed the problem for me.
vue.config.js
it was in devServer -> watchOptions -> poll: true
. Setting it to false removed cpu eating (while watching files works). –
Note Installing the fsevents
module on MacOSX will help reduce the CPU usage.
npm install fsevents -g
npm rebuild fsevents
xcode-select --install
which was quick, fsevents installed and the high CPU usage dropped immediately. –
Lightner npm rebuild fsevents
after migrating to an M1 machine. –
Gymnasiarch The problem was caused by the polling option.
Removing poll: true
from the watchOptions
in the webpack config - fixed the problem for me.
vue.config.js
it was in devServer -> watchOptions -> poll: true
. Setting it to false removed cpu eating (while watching files works). –
Note i use linux in virtualbox for dev purpose, and i have shared folder from windows host to linux guest. and my my vue project is stored in my hdd and shared with vbox.
so that i have to used {devServer: watchOptions: {poll: true}}
in my vue.config.js for hot reload to works. this was causing the high cpu usage problem.
so i put my code in guest hdd and set poll:false and problem has gone.
hope someone find this helpfull.
© 2022 - 2024 — McMap. All rights reserved.