From bc1414ed323a2232d1ea8ae13c6e77ea0510075a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 00:29:42 +0000 Subject: [PATCH 1/2] docs: explain empty reports when __coverage__ is created after load (#843) Nuxt 3 with vite-plugin-istanbul only instruments lazily imported page modules, so window.__coverage__ is created after the page's load event. Versions before 4.1.2 read coverage only on load and wrote an empty out.json. 4.1.2 (#1007) also reads each page before it unloads and at the end of each test, and test-apps/swc-webpack guards that behavior. Add a Common issues entry so users still on 3.x who see the coverage object in DevTools but get an empty report know to upgrade. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WUv8r1DKMrtbUrcHzyPuof --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 744087cd..cc1cfc71 100644 --- a/README.md +++ b/README.md @@ -1106,6 +1106,10 @@ it('loads an instrumented app', () => { }) ``` +### `window.__coverage__` exists but the report is empty + +If DevTools shows `window.__coverage__` on your page but `.nyc_output/out.json` is empty, your app probably creates the coverage object after the page's `load` event. That happens when the only instrumented files load later, for example route components that Nuxt or Vue Router import lazily, or code that runs during hydration. Versions before 4.1.2 only read the coverage object on `load`, so they missed it. Upgrade to 4.1.2 or later, which reads each page again before it unloads and at the end of each test. See [#843](https://github.com/cypress-io/code-coverage/issues/843). + ### Coverage reporting timeouts If the plugin times out when sending coverage report data to be merged, this may be due to a very large From 5792459b35a31b009887f4a0524307485b667e9d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 00:35:44 +0000 Subject: [PATCH 2/2] docs: point 3.x users to the migration guide in the #843 note Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WUv8r1DKMrtbUrcHzyPuof --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc1cfc71..c68baa2a 100644 --- a/README.md +++ b/README.md @@ -1108,7 +1108,7 @@ it('loads an instrumented app', () => { ### `window.__coverage__` exists but the report is empty -If DevTools shows `window.__coverage__` on your page but `.nyc_output/out.json` is empty, your app probably creates the coverage object after the page's `load` event. That happens when the only instrumented files load later, for example route components that Nuxt or Vue Router import lazily, or code that runs during hydration. Versions before 4.1.2 only read the coverage object on `load`, so they missed it. Upgrade to 4.1.2 or later, which reads each page again before it unloads and at the end of each test. See [#843](https://github.com/cypress-io/code-coverage/issues/843). +If DevTools shows `window.__coverage__` on your page but `.nyc_output/out.json` is empty, your app probably creates the coverage object after the page's `load` event. That happens when the only instrumented files load later, for example route components that Nuxt or Vue Router import lazily, or code that runs during hydration. Versions before 4.1.2 read the coverage object only on `load` and at the start of each test, so they missed it. Upgrade to 4.1.2 or later, which reads each page again before it unloads and at the end of each test. If you're on 3.x, follow the [3.x to 4.x migration](#cypresscode-coverage-3x-to-4x) first. See [#843](https://github.com/cypress-io/code-coverage/issues/843). ### Coverage reporting timeouts