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

TypeError: Cannot read property 'replace' of undefined #134

Closed
viceice opened this issue Mar 1, 2021 · 1 comment · Fixed by #135
Closed

TypeError: Cannot read property 'replace' of undefined #134

viceice opened this issue Mar 1, 2021 · 1 comment · Fixed by #135

Comments

@viceice
Copy link
Contributor

viceice commented Mar 1, 2021

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch v8-to-istanbul@7.1.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/v8-to-istanbul/lib/v8-to-istanbul.js b/node_modules/v8-to-istanbul/lib/v8-to-istanbul.js
index 428c02a..e5be920 100644
--- a/node_modules/v8-to-istanbul/lib/v8-to-istanbul.js
+++ b/node_modules/v8-to-istanbul/lib/v8-to-istanbul.js
@@ -54,7 +54,7 @@ module.exports = class V8ToIstanbul {
         this.sourceTranspiled = new CovSource(rawSource, this.wrapperLength)
       } else {
         const candidatePath = this.rawSourceMap.sourcemap.sources.length >= 1 ? this.rawSourceMap.sourcemap.sources[0] : this.rawSourceMap.sourcemap.file
-        this.path = this._resolveSource(this.rawSourceMap, candidatePath)
+        this.path = this._resolveSource(this.rawSourceMap, candidatePath || this.path)
         this.sourceMap = await new SourceMapConsumer(this.rawSourceMap.sourcemap)
 
         let originalRawSource

This issue body was partially generated by patch-package.

@viceice
Copy link
Contributor Author

viceice commented Mar 1, 2021

TypeError: Cannot read property 'replace' of undefined
    at V8ToIstanbul._resolveSource (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\v8-to-istanbul\lib\v8-to-istanbul.js:86:29)
    at V8ToIstanbul.load (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\v8-to-istanbul\lib\v8-to-istanbul.js:57:26)
    at C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\reporters\build\CoverageReporter.js:624:27
    at Array.map (<anonymous>)
    at CoverageReporter._getCoverageResult (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\reporters\build\CoverageReporter.js:587:32)
    at CoverageReporter.onRunComplete (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\reporters\build\CoverageReporter.js:231:45)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async ReporterDispatcher.onRunComplete (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\core\build\ReporterDispatcher.js:88:9)
    at async TestScheduler.scheduleTests (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\core\build\TestScheduler.js:350:5)
    at async runJest (C:\Users\kriese\projects\gh\renovatebot\renovate\node_modules\@jest\core\build\runJest.js:376:19)

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

Successfully merging a pull request may close this issue.

1 participant