Hello, there is a question. When the jenkins plugin SonarQubeScanner-2.12 scans js files. Throw an exception that the file cannot be parsed. The reason is the try-catch statement, the catch statement has no err parameter. Such as try{}catch{}. This way of using is supported in js. How can I solve this problem.
Hello @Vea,
Can you send the full logs of your scanner instead of a screenshot. We cannot investigated based on screenshots of code or logs.
For information what matters is not much the version of the SonarQube scanner but the JavaScript plugin installed on your SonarQube platform. Can you verify the plugin is up to date ?
What version of SonarQube do you use ?
What version of SonarJS (the JavaScript analyser) do you use ?
Merry Christmas
Olivier
Here is my env.Thanks for your help.
SonarQube Community Edition - v7.7 (build 23042)
SonarJS 5.1.1 (build 7506)
Merry Christmas
vea
Hello @Vea,
Sorry for the delay, I took a well deserved Christmas break
Happy New Year !
I looked at your logs. I saw the parsing error. It it probably due to a too old version of SonarQube or the SonarJS plugin. Please fix the following problems and I am confident it will work
- You’re running SonarQube 7.7. It’s very old and no longer supported. I encourage you to upgrade to SonarQube 7.9 at least (the current LTS: Long Term Support) version, or the latest and greatest SonarQube 8.6. Please check the download links at https://www.sonarqube.org/downloads/
- With 8.6 the latest and greatest JavaScript analyzer is already included. If you choose 7.9, please upgrade the SonarJS plugin to the latest available and compatible version (the marketplace page in SonarQube will let you do that easily)
- I also noticed the error:
org.sonarsource.nodejs.NodeCommandException: Failed to start server (10s timeout)
- That’s probably more serious than the parsing error. Can you make sure you meet the prerequisites of having Node.JS 10 or higher installed on your machine, and if not in the path, add the
sonar.nodejs.executable
to the Scanner configuration.
Refer to https://docs.sonarqube.org/latest/analysis/languages/javascript/
Olivier