Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught error while navigating #92

Open
mistic100 opened this issue Nov 10, 2024 · 1 comment
Open

Uncaught error while navigating #92

mistic100 opened this issue Nov 10, 2024 · 1 comment

Comments

@mistic100
Copy link

Describe the bug
Hi
I am trying to generate the HTML report for a TypeScript project. The setup is rather complex and involves tsup (esbuild) + a custom plugin to instrument each source file + Cypress + @lcov-viewer/istanbul-report

The report generates correctly but I cannot open any file details and the following error is visible in the console.

1-error
2-location

It corresponds to this line

const lineTextBefore = lines[line].slice(0, col);

I debugued this piece of code and found that the line variable is NaN. The iterated variable mergedInsertions contains valid and invalid values.

3-code

Here is my report-data.js, by the look of it, it contains the source code and no NaN anywhere
report-data.zip

Also the default IstanbulJS lcov HTML report works perfectly.

Thank you for your time

@mistic100
Copy link
Author

My setup was inspired by https://www.npmjs.com/package/esbuild-plugin-istanbul which instrument each source file individually.

I then tried to just call nyc instrument on the final bundled file and now the report is working.

I keep this issue open if you want to check why there are NaNs floating arround but feel free to close if its because my report-data is corrupted somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant