SonarSource / SonarTS

Static code analyzer for TypeScript
GNU Lesser General Public License v3.0
761 stars 53 forks source link

Error related to node --max-space-size #903

Closed vickyrocky closed 4 years ago

vickyrocky commented 4 years ago

SonarTS - 1.7 (customized as per my requirement) Sonarqube - 7.9.1 (migrated from 6.7) Scanner - 3.3 Platform - Linux

While running sonar-scan i am getting below error. Any help would be highly appreciated.

06:18:28.039 DEBUG: Analyzing 58 typescript file(s) with the following configuration file /var/lib/jenkins/workspace/f_test/projects/api/management-services/generators/server/express/tsconfig.json
06:18:28.041 DEBUG: Starting external process `node --max-old-space-size=2048 /var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner`
06:18:29.424 ERROR: /var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/lib/utils/parser.js:89
06:18:29.424 ERROR:             throw new Error(ts.formatDiagnostics(errors, {
06:18:29.424 ERROR:             ^
06:18:29.424 ERROR:
06:18:29.424 ERROR: Error: error TS5012: Cannot read file '/var/lib/jenkins/workspace/f_test/projects/api/tsconfig.json': ENOENT: no such file or directory, open '/var/lib/jenkins/workspace/f_test/projects/api/tsconfig.json'.
06:18:29.424 ERROR:
06:18:29.424 ERROR:     at parseTsConfig (/var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/lib/utils/parser.js:89:19)
06:18:29.424 ERROR:     at Object.createProgram (/var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/lib/utils/parser.js:61:32)
06:18:29.424 ERROR:     at Object.processRequest (/var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/lib/runner/processRequest.js:32:28)
06:18:29.424 ERROR:     at Socket.process.stdin.on (/var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/lib/runner/tsrunner.js:32:38)
06:18:29.424 ERROR:     at Socket.emit (events.js:187:15)
06:18:29.424 ERROR:     at endReadableNT (_stream_readable.js:1094:12)
06:18:29.425 ERROR:     at process._tickCallback (internal/process/next_tick.js:63:19)
06:18:29.431 ERROR: External process `node --max-old-space-size=2048 /var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner` returned an empty output. Run with -X for more information
06:18:29.431 DEBUG: Analyzing 1337 typescript file(s) with the following configuration file /var/lib/jenkins/workspace/f_test/tsconfig.json
06:18:29.477 DEBUG: Starting external process `node --max-old-space-size=2048 /var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner`
^C06:18:33.739 ERROR: External process `node --max-old-space-size=2048 /var/lib/jenkins/workspace/f_test/.scannerwork/sonarts-bundle/node_modules/tslint-sonarts/bin/tsrunner` returned an empty output. Run with -X for more information
06:18:33.740 INFO: Sensor SonarTS [typescript] (done) | time=71715ms
06:18:33.740 INFO: Sensor SonarTS Coverage [typescript]
06:18:33.740 INFO: Sensor SonarTS Coverage [typescript] (done) | time=0ms

Regards, Vicky

vilchik-elena commented 4 years ago

Hi,

we are not maintaining SonarTS anymore. TS analysis is performed by SonarJS. Could you upgrade to SonarJS 6.x and if you gonna still have problems please report in https://github.com/SonarSource/SonarJS/issues

vickyrocky commented 4 years ago

Hi @vilchik-elena , it would be great if you can give me any clue regarding this issue as i am using this customized plugin in production and i can't just migrate to SonarJS right away. But, anyway i would be migrating this later to SonarJS as suggested by you. Any help on this would be highly appreciated.

vilchik-elena commented 4 years ago

Looks like when we are analyzing files with /var/lib/jenkins/workspace/f_test/projects/api/management-services/generators/server/express/tsconfig.json, there is a problem reading /var/lib/jenkins/workspace/f_test/projects/api/tsconfig.json (it might be extended by first tsconfig)

Error: error TS5012: Cannot read file '/var/lib/jenkins/workspace/f_test/projects/api/tsconfig.json': ENOENT: no such file or directory, open '/var/lib/jenkins/workspace/f_test/projects/api/tsconfig.json'
vickyrocky commented 4 years ago

@vilchik-elena Thanks a lot. Indeed issue was with this file and i was running after something else. Dumb me :(