I’m running a code analysis with npm sonar-scanner command in a bitbucket pipeline script over a react typescript monorepo.
Since a couple of days I started having an error without any infrastructure change.
Node version: 22.14
sonarqube-scanner@4.3.4
This is the bitbucket-pipelines.yml snippet that calls sonar-scanner:
- export SONAR_TSCONFIG_PATHS=$(find apps/*/tsconfig.json packages/*/tsconfig.json 2>/dev/null | paste -sd,)
- >
pnpm --dir . exec sonar-scanner
-Dsonar.projectBaseDir=.
-Dsonar.sources=$SONAR_SOURCES
-Dsonar.tests=$SONAR_SOURCES
-Dsonar.typescript.tsconfigPaths=$SONAR_TSCONFIG_PATHS
-Dsonar.qualitygate.wait=true
This is the error:
16:52:33.168 INFO Plugin version: [11.8.0.37897]
16:52:37.479 ERROR TypeError: Error while loading rule 'sonarjs/S6957': Invalid comparator: catalog:frontend
16:52:37.480 ERROR Occurred while linting /opt/atlassian/pipelines/agent/build/packages/icons/src/types.ts
16:52:37.480 ERROR at e.parse (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:52732)
16:52:37.480 ERROR at new e (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:52525)
16:52:37.480 ERROR at /opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:48601
16:52:37.480 ERROR at Array.map (<anonymous>)
16:52:37.480 ERROR at e.parseRange (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:48594)
16:52:37.480 ERROR at /opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:47264
16:52:37.480 ERROR at Array.map (<anonymous>)
16:52:37.480 ERROR at new e (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:47252)
16:52:37.480 ERROR at lTu (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:722:54886)
16:52:37.480 ERROR at e$t (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:2302:43215)
16:52:38.380 INFO Found 4 tsconfig.json file(s): [/opt/atlassian/pipelines/agent/build/tooling/vitest/tsconfig.json, /opt/atlassian/pipelines/agent/build/tooling/prettier/tsconfig.json, /opt/atlassian/pipelines/agent/build/packages/icons/tsconfig.json, /opt/atlassian/pipelines/agent/build/apps/docs/tsconfig.json]
16:52:38.381 INFO 6 source files to be analyzed
From what I could see, the plugin version changed. Before it was using version 11.7.0.36965 and we did not have any errors. Now with version 11.8.0.37897 we have the issue.
Also checked the Quality profiles for our project in sonarcloud.io to see if there were any new sonar profile rules added and there was only one added on 26.Jan.2026 (“Function references should not be passed directly to iterator methods“) which is not related with ‘sonarjs/S6957’ that is referenced in the error log.
It seems to have something to do with pnpm workspace catalogs. If we change all package.json files of the monorepo to use the concrete versions (instead of catalog) we do not get the error. Anyhow, we are using catalogs for months now and we did not have this issue with sonar scanner.
Any ideas?
Thanks in advance.