You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cypress cannot see the window.__coverage__ object #843
What is this plugin's version? If this is NOT the latest released version, can you try the latest version, please? 3.12.39 (latest)
If the plugin worked before in version X but stopped after upgrading to version Y, please try the released versions between X and Y to see where the breaking change was.
When running tests, if you open the web application in a regular browser and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot? yes (screenshot above)
Is there a .nyc_output folder? Is there a .nyc_output/out.json file? Is it empty? Can you paste at least part of it so we can see the keys and file paths? yes, but empty
Do you have any custom NYC settings in package.json (nyc object) or in other NYC config files? no
Do you run Cypress tests in a Docker container? no
Describe the bug
When launching E2E tests using Cypress with a nuxt 3 stack, I run into the following problem:
The window.__coverage__ object is preset (see screenshot), but Cypress does not manage to find it
Only pages/* and utils/* are instrumented in the repro, and Nuxt imports page components lazily, so window.__coverage__ is created after the page's load event. Versions before 4.1.2 read coverage only on load and at the start of each test, so out.json was empty.
4.1.2 also reads each page before it unloads and at the end of each test (#1007). 4.x requires Cypress 15.10 or later and reads options from expose instead of env. See the 3.x to 4.x migration guide. The README's Common issues section now covers this symptom (#1014).
If the report is still empty on 4.1.2 or later, open a new issue with DEBUG=code-coverage output and the value of cy.window().its('__coverage__') from your test.
Activity
docs: point 3.x users to the migration guide in the #843 note
docs: explain empty reports when __coverage__ is created after load (#…
jennifer-shehane commentedon Nov 2, 2026
This is fixed in 4.1.2.
Only
pages/*andutils/*are instrumented in the repro, and Nuxt imports page components lazily, sowindow.__coverage__is created after the page'sloadevent. Versions before 4.1.2 read coverage only onloadand at the start of each test, soout.jsonwas empty.4.1.2 also reads each page before it unloads and at the end of each test (#1007). 4.x requires Cypress 15.10 or later and reads options from
exposeinstead ofenv. See the 3.x to 4.x migration guide. The README's Common issues section now covers this symptom (#1014).If the report is still empty on 4.1.2 or later, open a new issue with
DEBUG=code-coverageoutput and the value ofcy.window().its('__coverage__')from your test.github-actions commentedon Nov 2, 2026
🎉 This issue has been resolved in version 4.1.3 🎉
The release is available on:
Your semantic-release bot 📦🚀