When the jenkins plugin SonarQubeScanner-2.12 scans js files. Throw an exception that the file cannot be parsed

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 ?

:christmas_tree: Merry Christmas :christmas_tree:

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

Can you send the Jenkins logs @Vea ?

I reproduced the problem locally.Please check it.log.txt (15.4 KB)

This post was flagged by the community and is temporarily hidden.

Hello @Vea,

Sorry for the delay, I took a well deserved Christmas break :slight_smile:
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)

Olivier