WebStorm causing CPU spikes

I just started a new node project in WebStorm and I'm getting a lot of CPU spikes. I can't tell if it's related to having a particular file open or not. Sometimes it seems like the CPU activity dies off after I close certain files but it's not consistent. I have every directory except my source code set to Excluded. I don't think it's an indexing thing. Or if it is, WebStorm is not stating that in the UI.

I have the unused global symbol inspections turned off. I have also tried invalidating the cache and restarting several times. Nothing seems to be helping.

This is a TypeScript project btw. Maybe the parser??

I did manage to catch one of the spikes in the CPU profiler. I have attache the file, which is called WS-173.3727.108_dave_08.04.2018_15.07.44.zip.

 

9 comments

Please can you provide your tsconfig.json and package.json?

Also, please make sure that all build destination folders are excluded from project

0

The build destination folder is excluded.

Here is package.json:

{
"name": "my-project",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "npm run build && node dist/my-project/src/main.js",
"build": "tsc",
"test": "NODE_ENV=test npm run test:cover",
"test:unit": "NODE_ENV=test mocha -r ts-node/register src/**/*.test.ts --bail",
"test:cover": "NODE_ENV=test nyc npm run test:unit",
"lint": "tslint -c ../tslint.json src/**/*.ts",
"clean": "../node_modules/.bin/rimraf dist/*"
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"dependencies": {
"@types/cheerio": "0.22.7",
"cheerio": "1.0.0-rc.2",
"request": "2.85.0",
"typescript": "2.8.1"
},
"devDependencies": {
"mocha": "5.0.5",
"nyc": "11.6.0"
}
}

 

Here is also a package.json in the parent folder:

{
"name": "parent",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"dependencies": {
"cross-env": "5.1.4",
"pg": "7.4.1",
"pg-hstore": "2.3.2",
"sequelize": "4.37.6",
"source-map-support": "0.5.4",
"typescript": "2.8.1",
"winston": "2.4.1"
},
"devDependencies": {
"@types/request": "2.47.0",
"@types/sinon": "4.3.1",
"chai": "4.1.2",
"istanbul": "1.1.0-alpha.1",
"mocha": "5.0.5",
"rimraf": "2.6.2",
"sinon": "4.5.0",
"ts-node": "5.0.1",
"tslint": "5.9.1"
}
}

 

Here is tsconfig.json:

{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"lib": ["es2015"]
},
"exclude": [
"node_modules"
]
}

 

0

Please try moving

"typescript": "2.8.1"

from "dependencies" to "devDependencies" in your package.json files - this should make things better

0

Okay, I'll give it a shot. I didn't realize that WebStorm treated regular dependencies and dev dependencies differently.

 

 

0

also, please can you provide a screenshot of Preferences | Languages & Frameworks | JavaScript | Libraries page?

0

Looks OK, as far as I can see. Did you try moving "typescript" to "devDependencies" ?

0

I have yes. I will work with it a bit and let you know how it goes.

 

0

This seems to be working, thank you for the help.

 

0

Please sign in to leave a comment.