You are using version of TypeScript 3.1.6 which is not supported; supported versions >=3.2.1

Template for a good bug report, formatted with Markdown:

  • versions used SonarCloud
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    Overnight our sonar_scanning on the CI machine got the following error in the logs:
build	09-Oct-2019 07:42:33	07:42:33.681 INFO: Sensor ESLint-based TypeScript analysis [javascript]
build	09-Oct-2019 07:42:33	07:42:33.683 DEBUG: SonarJS eslint-bridge server is up, no need to start.
build	09-Oct-2019 07:42:33	07:42:33.685 INFO: 605 source files to be analyzed
build	09-Oct-2019 07:42:34	07:42:34.494 INFO: Found 1 tsconfig.json file(s): [/home/bamboo/bamboo-agent-home/xml-data/build-dir/DAS-DBLY-BTEU/Dashworks.Junior.UI/UI/tsconfig.json]
error	09-Oct-2019 07:42:34	07:42:34.522 ERROR: Failed to analyze file [src/app/components/admin/objects/details/team/buckets/list/comp.ts]: You are using version of TypeScript 3.1.6 which is not supported; supported versions >=3.2.1
error	09-Oct-2019 07:42:34	07:42:34.524 ERROR: Failure during analysis, Node.js command to start eslint-bridge was: {NODE_PATH=/home/bamboo/bamboo-agent-home/xml-data/build-dir/DAS-DBLY-BTEU/Dashworks.Junior.UI/UI/node_modules/@schematics/angular/node_modules} node /home/bamboo/bamboo-agent-home/xml-data/build-dir/DAS-DBLY-BTEU/Dashworks.Junior.UI/UI/.scannerwork/.sonartmp/eslint-bridge-bundle/node_modules/eslint-bridge/bin/server 43755
error	09-Oct-2019 07:42:34	java.lang.IllegalStateException: Unsupported TypeScript version
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.processParsingError(AbstractEslintSensor.java:149)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.processResponse(AbstractEslintSensor.java:194)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.TypeScriptSensor.analyze(TypeScriptSensor.java:144)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.TypeScriptSensor.analyzeFilesWithTsConfigs(TypeScriptSensor.java:131)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.TypeScriptSensor.analyzeFiles(TypeScriptSensor.java:108)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:115)
error	09-Oct-2019 07:42:34		at org.sonar.plugins.javascript.eslint.TypeScriptSensor.execute(TypeScriptSensor.java:49)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:403)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:399)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:362)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
error	09-Oct-2019 07:42:34		at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
error	09-Oct-2019 07:42:34		at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
error	09-Oct-2019 07:42:34		at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
error	09-Oct-2019 07:42:34		at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
error	09-Oct-2019 07:42:34		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
error	09-Oct-2019 07:42:34		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
error	09-Oct-2019 07:42:34		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
error	09-Oct-2019 07:42:34		at java.lang.reflect.Method.invoke(Method.java:498)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
error	09-Oct-2019 07:42:34		at com.sun.proxy.$Proxy0.execute(Unknown Source)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
error	09-Oct-2019 07:42:34		at org.sonarsource.scanner.cli.Main.main(Main.java:61)
  • steps to reproduce
    Run the sonar_scanner
  • potential workaround
    I’m guessing we could upgrade our TypeScript to the latest version. However it would be interesting to know how this error occured. As this was running fine yesterday and today it’s broken and the code smells and duplication figures have dropped dramtically

P.S.: use the #bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

I have the same error in one of our pipelines today and also it was working with an older Typescript version before

A new version of SonarJS (which now is responsible for Typescript analysis… it’s a long journey) was deployed that bumped the version requirement.

The docs were updated but this probably could have been communicated more strongly. Hope your pipelines are back in good shape now!

This is quite unfortunate. We are running multiple projects on Typescript 2.9 still and those are no longer analysed and as a result we have had breaking builds since this change and the Sonarcloud dashboards are no longer showing any data. A major version change is far from trivial unfortunately and this change has quite some impact on our work.

Is there any way you could make this change backwards compatible? Or is there any suggestion for a workaround?

What would be the way to become informed upfront of these changes? Is there a mailing list that we can subscribe to or something else in order to be informed of such changes?

Hi,

In it’s not strictly required to have version of TypeScript available during analysis the same as the version used to build the project. TypeScript >=3.2.1 is required as we are using some TypeScript API available since that version.
So just install TypeScript >=3.2.1 for the analysis time. There might be some differences with type resolution, but most probably it will not affect analysis results.

Hope it helps!

1 Like