I’m running a code analysis with npm sonar-scanner command in a bitbucket pipeline script over a react typescript monorepo that is using the automatic JSX runtime (jsx: "react-jsx")
Since a couple of days I started having an error without any infrastructure change.
Node version: 24.13
Typescript version: 5.9.3
sonarqube-scanner@4.3.5
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:
[INFO] ScannerEngine: Plugin version: [12.1.0.39434]
[INFO] ScannerEngine: Resolving provided TSConfig files using '/opt/atlassian/pipelines/agent/build/apps/server/tsconfig.json,/opt/atlassian/pipelines/agent/build/apps/web/tsconfig.json,/opt/atlassian/pipelines/agent/build/packages/api/tsconfig.json,...'
[ERROR] ScannerEngine: Error: Debug Failure. False expression: Expected sourceFile.imports[0] to be the synthesized JSX runtime import
[ERROR] ScannerEngine: Occurred while linting /opt/atlassian/pipelines/agent/build/packages/api/src/components/global-search/global-search.tsx:1
[ERROR] ScannerEngine: Rule: "sonarjs/S1874"
[ERROR] ScannerEngine: at qwl (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:546754)
[ERROR] ScannerEngine: at k5t (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:295906)
[ERROR] ScannerEngine: at jfe (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:296127)
[ERROR] ScannerEngine: at Bse (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:294738)
[ERROR] ScannerEngine: at Hst (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:298355)
[ERROR] ScannerEngine: at nvl (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:291812)
[ERROR] ScannerEngine: at kbl (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:391798)
[ERROR] ScannerEngine: at tp (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:389655)
[ERROR] ScannerEngine: at i_ (/opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:385046)
[ERROR] ScannerEngine: at /opt/atlassian/pipelines/agent/build/.scannerwork/.sonartmp/bridge-bundle/package/bin/server.cjs:542:361572
[INFO] ScannerEngine: Found 14 tsconfig.json file(s): [/opt/atlassian/pipelines/agent/build/apps/server/tsconfig.json, /opt/atlassian/pipelines/agent/build/apps/web/tsconfig.json, /opt/atlassian/pipelines/agent/build/packages/api/tsconfig.json, ...]
From what I could see, the plugin version changed. Before it was using version 12.0.0.38664 and we did not have any errors. Now with version 12.1.0.39434 we have the issue.
The error occurs on multiple .tsx files during analysis. The scanner continues but reports these errors for many TSX files.
tsconfig.json configuration:
{
"compilerOptions": {
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES6",
"lib": ["DOM", "DOM.Iterable", "ESNext"]
}
}
Also checked the Quality profiles for our project in sonarcloud.io to see if there were any new sonar profile rules, and that is not the case.
Any ideas?
Thanks in advance.