This started happening on 22 Sep. A scan at Mon, 22 Sep 2025 10:06:38 GMT worked showed correct coverage, but our next one at Mon, 22 Sep 2025 10:40:59 GMT showed 0% coverage
No significant code change or sonar config change was made in this time. The change between these two runs was an update of code dependencies. I have tried reverting this change in a pull request and still get 0% coverage on the pull request.
It is also affecting other typescript projects we have (but have picked this one as its the smallest time window between it working and not working)
ALM used: Github
CI system used: Github actions
Scanner command used when applicable : github actions - SonarSource/sonarqube-scan-action@master (have also tried with v6.0.0)
Languages of the repository: typescript
Only if the SonarCloud project is public, the URL - SonarQube Cloud
*
Error observed:
Coverage is showing as 0%
A scan at Mon, 22 Sep 2025 10:06:38 GMT worked showed correct coverage, but our next one at Mon, 22 Sep 2025 10:40:59 GMT showed 0% coverage
from what I see in the sonar properties of your project I see the problem. The JS/TS analyzer has dropped support for modules, as it was never fully supported (even if it worked in your case) and it was mostly for other scanners like Maven and dotnet. Can you please change your sonar properties to something like this:
I have worked around it by combining all the lcov.info files and rewriting the filenames in them to be full path using this script
#!/usr/bin/env bash
set -euo pipefail
output=coverage/lcov.info
mkdir -p coverage
true > “$output”
for pkg in packages/\*; do
if \[\[ -f “$pkg/coverage/lcov.info” \]\]; then
# Rewrite paths in lcov.info to be relative to repo root
sed “s|^SF:|SF:$pkg/|” “$pkg/coverage/lcov.info” >> “$output”
fi
done
which seems to have worked - when there is no coverage for a new file with the same name as in another module, it shows 0% coverage. When there is coverage for a new file it shows the correct coverag