Open ibrocodes7 opened 1 year ago
Same issue here
Same issue here. Were you able to fix it?
It is simply because the source map file does not exist -- here in the v8-to-istanbul.js
If there is any hint that the file uses source map, it tries to read the source map file. However in many cases it does not exist (e.g. third-party library did not ship source map along with bundled code when packaging), as what happened to you here. To me this is a mistake -- the "missing source map" problem is often out of user's control, and user should not be prevented from collecting coverage because of it. Most of the time the source map is for a third-party library which the user does not care about anyway.
If you want a workaround, you can just simply wrap the code in try-catch in your local node_modules
:
try {
this.rawSourceMap = this.sources.sourceMap || rcmap = convertSourceMap.fromSource(rawSource) || convertSourceMap.fromMapFileSource(rawSource, this._readFileFromDir.bind(this));
} catch {
this.rawSourceMap = null;
}
But apparently this won't work in CI.
I think should be patched.
@bcoe Could you consider this? I'll be happy to create a pull request for this.
@rwalle I would consider a patch for this. I think we should warn on the console as well as setting this.rawSourceMap = null
, if we have metadata indicating a source map, but no source map.
@rwalle I would consider a patch for this. I think we should warn on the console as well as setting
this.rawSourceMap = null
, if we have metadata indicating a source map, but no source map.
finally got back to this. The change is simple enough, but should I add a test? (I guess so.) If the code does console.warn
, the only thing to test this would be to override console.warn
in the test -- not sure you want to do that. Other methods like injecting a logger would mean adding more code elsewhere. How would you like to proceed?
Hi, I am trying to use the package with playwright version 1.24. I am seeing some console errors while trying to collect the coverage.
I followed the instructions as per https://playwright.dev/docs/api/class-coverage.
Error: