Closed ericmorand closed 4 months ago
This is a known issue, but we can't fix it.
Nodejs only exports lineLengths
of generated codes and doesn't export generated codes self, so we can only get a fake source code. see issue and source-map-cache
I'm afraid we need to fix it on Nodejs side.
Alternatively, I've thought a solution, such as using Nodejs hooks to export generated code.
see ts-node exmaple: https://github.com/cenfun/mcr-ts-node/tree/main
and the hooks source codes: https://github.com/cenfun/monocart-coverage-reports/blob/main/lib/register/hooks.js#L46
Since they are not in the console output, maybe it is possible to remove them also from the html one ?
They are in the HTML list because option logging
has been set as debug
for debugging purposes. Therefore, changing logging
to info
can remove them. see debug-for-coverage-and-sourcemap
Oooooooooooooooooooh. Thank you!
Describe the bug
Using this reproduction repository (https://github.com/ericmorand/c8-with-bundle), executing the command:
Displays the expected console output:
But display the fake sources in the V8 HTML output:
Expected behavior
The V8 report and the console one are consistent.
Additional context
I'd like to fix this but I need some context to understand the underlying issue.