Cypress error: `cy.task('coverageReport')` failed - Cannot read properties of undefined (reading 'start')
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cypress, typescript
- 領域
- testing
調査の方向性
リンクされた imagelightbox のコミットで失敗を再現することから始め、generateReport の support.js、.nyc_output/out.json のデータ、およびログに記載された NYC/istanbul のスタックエントリを調査します。Cypress after-all の coverageReport task のパスを確認します。Spec が完了し、coverage reporting が undefined start error なしで lcov 出力を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Logs and screenshots
Hi,
I get the following error in cypress (this is the output from "Print to console"):
CypressError: `cy.task('coverageReport')` failed with the following error:
> Cannot read properties of undefined (reading 'start')
Because this error occurred during a `after all` hook we are skipping all of the remaining tests.
at ../driver/src/cy/commands/task.ts/__webpack_exports__.default/task (http://localhost:8080/__cypress/runner/cypress_runner.js:145775:78)
From previous event:
at task (http://localhost:8080/__cypress/runner/cypress_runner.js:145757:10)
at ../driver/src/cypress/cy.ts/addCommand/wrap (http://localhost:8080/__cypress/runner/cypress_runner.js:157372:43)
From Your Spec Code:
at generateReport (webpack:///./node_modules/@cypress/code-coverage/support.js:200:0)
at ../driver/src/cypress/cy.ts/setRunnable/runnable.fn (http://localhost:8080/__cypress/runner/cypress_runner.js:157640:43)
at callFn (http://localhost:8080/__cypress/runner/cypress_runner.js:107910:21)
at ../driver/node_modules/mocha/lib/runnable.js/</Runnable.prototype.run (http://localhost:8080/__cypress/runner/cypress_runner.js:107897:13)
at ../driver/src/cypress/runner.ts/create/onRunnableRun (http://localhost:8080/__cypress/runner/cypress_runner.js:164958:30)
at finallyHandler (http://localhost:8080/__cypress/runner/cypress_runner.js:7872:23)
at tryCatcher (http://localhost:8080/__cypress/runner/cypress_runner.js:11318:23)
at ../../node_modules/bluebird/js/release/promise.js/</module.exports/Promise.prototype._settlePromiseFromHandler (http://localhost:8080/__cypress/runner/cypress_runner.js:9253:31)
at ../../node_modules/bluebird/js/release/promise.js/</module.exports/Promise.prototype._settlePromise (http://localhost:8080/__cypress/runner/cypress_runner.js:9310:18)
at ../../node_modules/bluebird/js/release/promise.js/</module.exports/Promise.prototype._settlePromise0 (http://localhost:8080/__cypress/runner/cypress_runner.js:9355:10)
at ../../node_modules/bluebird/js/release/promise.js/</module.exports/Promise.prototype._settlePromises (http://localhost:8080/__cypress/runner/cypress_runner.js:9435:18)
at _drainQueueStep (http://localhost:8080/__cypress/runner/cypress_runner.js:6025:12)
at _drainQueue (http://localhost:8080/__cypress/runner/cypress_runner.js:6018:24)
at ../../node_modules/bluebird/js/release/async.js/</Async.prototype._drainQueues (http://localhost:8080/__cypress/runner/cypress_runner.js:6034:16)
at ../../node_modules/bluebird/js/release/async.js/</Async/this.drainQueues (http://localhost:8080/__cypress/runner/cypress_runner.js:5904:14)
From Node.js Internals:
TypeError: Cannot read properties of undefined (reading 'start')
at <unknown> (/home/user/project/node_modules/istanbul-reports/lib/lcovonly/index.js:59:43)
at Array.forEach (<anonymous>)
at LcovOnlyReport.onDetail (/home/user/project/node_modules/istanbul-reports/lib/lcovonly/index.js:56:34)
at LcovReport.<computed> [as onDetail] (/home/user/project/node_modules/istanbul-reports/lib/lcov/index.js:25:23)
at Visitor.value (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:38:38)
at ReportNode.visit (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:88:21)
at <unknown> (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:92:19)
at Array.forEach (<anonymous>)
at ReportNode.visit (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:91:28)
at <unknown> (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:92:19)
at Array.forEach (<anonymous>)
at ReportNode.visit (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:91:28)
at ReportTree.visit (/home/user/project/node_modules/istanbul-lib-report/lib/tree.js:127:24)
at LcovReport.execute (/home/user/project/node_modules/istanbul-lib-report/lib/report-base.js:12:44)
at <unknown> (/home/user/project/node_modules/nyc/index.js:467:10)
at Array.forEach (<anonymous>)
at NYC.report (/home/user/project/node_modules/nyc/index.js:461:19) [index.ce8ed54d.js:99335:13](http://localhost:8080/__/assets/index.ce8ed54d.js)
Versions
- What is this plugin's version?
3.10.0 - What is Cypress version?
10.10.0 - What is your operating system?
Debian testing - What is the shell?
zsh - What is the Node version?
v18.11.0 - What is the NPM version?
8.19.2 - How do you instrument your application? gulp-istanbul
- When running tests, if you open the web application in regular browser, and open DevTools, do you see
window.__coverage__object? Yes

- Is there
.nyc_outputfolder? Is there.nyc_output/out.jsonfile. Is it empty? Can you paste at least part of it so we can see the keys and file paths?
There is, pasting out.json:
{
"/home/user/project/src/file.js": {
"path": "/home/user/project",
"s": {
"1": 1,
"2": 1,
"3": 1
"...": "truncated"
}
}
}
- Do you have any custom NYC settings in
package.json(nycobject) or in other NYC config files No - Do you run Cypress tests in a Docker container? No
Describe the bug
When running a spec file, I get the error reported above.
Link to the repo
https://github.com/marekdedic/imagelightbox/commit/36513ec34716c92046bec270979108b5e3a23111
- 主要言語
- TypeScript
- スター
- 440
- フォーク
- 114
- 平均マージ
- 42分
- マージ済み PR(30日)
- 19
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cypress-io/code-coverage のほかの issue
-
難易度 3/5 半日 初心者へのやさしさ 40/100
cypress-io/code-coverage#1018 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cypress-io/code-coverage#993 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cypress-io/code-coverage#967 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cypress-io/code-coverage#959 ·
メンテナーはふだん 1 日以内に返信
-
performance
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
cypress-io/code-coverage#933 ·
メンテナーはふだん 1 日以内に返信
cypress-io/code-coverage の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/durable-harness#53 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area/docs area/ui enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
melgarafael/DeskcommCRM#4098 ·
メンテナーはふだん 1 日以内に返信
-
bug ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
kerti/balances-v2#801 ·
メンテナーはふだん 1 日以内に返信
-
lesson-submission pending-review
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
Ikalus1988/MisakaNet#4510 ·
メンテナーはふだん 1 日以内に返信