Coverage issues for Typescript (LCOV Could not resolve file paths)

Hey in one of our Projects we have encountered a strange issue. The project is in Typescript and during the introduction of branch support and PR decoration we found out, that currently, we have no code coverage. We have Typescript as the project language and up until a few weeks ago code coverage was working properly.
- SonarQube
- Scanner
- SonarTS 1.8 (build 3332)

We did not do any updates to the above mentioned plugins and altough I can see there is a newer version of SonarQube as well as SonarTS available this seems odd to me.

The issue is that all files that need to be resolved for the coverage (with LCOV) to work, cannot be resolved. I have gone ahead and resolved one of the filepaths manually and now that file has code coverage. The error message is:

WARN: Could not resolve xx file paths in [coverage/], first unresolved path:

With xx beeing the number of files we want code coverage for.

Are there any recommended steps to solve this issue?


When resolving a path from a coverage report, it should be either absolute or relative to project directory. Otherwise corresponding file is not found. What is it in your coverage report? what’s wrong with your paths?

Hey Elena,
thanks for the quick reply.

The contents of the file are:

followed by the analysis data. The data seems to be correct, because when I change this to the real path:
It is working.

So I don’t know if this is actually related to sonar or is a bug with LCOV or yarn coverage.

Indeed, this path starts from slash, thus it will be considered absolute by Sonarqube while it’s not. Check if you changed something in the way you generate this report.

Was a bug with typescript, fixed it using this. Thanks for the help.

@Lena. Please help with this issue.

Hello Team, I am seeing same issue for my typescript project. I did see data on after the scan. Due to this LCOV path resolve issues, sonar dashboard is not having coverage report (always shows ‘0’). Please do the needful.

My settings are

1 Like

any updates on this issue?

Please refer to the below link. It talks about a similar issue.

1 Like