Error while running scan for node js application

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube version:9.5
    sonar scanner version:4.7

  • what are you trying to achieve
    I am trying to scan node js project using below command
    sonar-scanner -Dsonar.projectKey=XXX -Dsonar.projectName=XXX -Dsonar.sources=. -Dsonar.language=js -Dsonar.exclusions=/*.java -Dsonar.coverage.exclusions=/*.java`

ERROR: TypeError: Cannot read property '0' of undefined
ERROR:     at LessParser.atrule(Path Name)

hello @TechTalks,

this looks like a problem in our CSS analyzer. Are you able to identify the file where this happens so we can try to reproduce the problem on our side? Could you please provide full logs?

Please find attached logs.

it seems analyzer is trying to analyze files in node_modules directory. This should be excluded. Can you add sonar.exclusions=**/node_modules/**

Added above line in exclusion still getting error for below files.

ERROR: at Root._error BaseDir\.sonartmp\eslint-bridge-bundle\package\node_modules\postcss-selector-parser\dist\parser.js:174:16)

Hi Community,

Any heads up would be highly appreciated…

Its resolved after excluding node_modules folder.
Thank you Tibor

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.