From 5764148f9c7c04f3730b0471ad525200bd4892d7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 22:20:54 +0000 Subject: [PATCH 1/2] docs: explain how to exclude bundler virtual modules from reports Bundlers such as Stencil's Rollup build emit virtual modules (for example `@lazy-browser-entrypoint?app-data=conditional`) that get instrumented but have no file on disk. `nyc report` then shows an "Unable to lookup source ... ENOENT" entry for them (older versions failed outright), and they count toward coverage totals. Document excluding them with `exclude` plus `excludeAfterRemap: true`. Refs #400 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WUv8r2pcQxLFLM65TTNcVW --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f76542f0..e6636caf 100644 --- a/README.md +++ b/README.md @@ -685,6 +685,19 @@ For example, if you want only to include files in the `app` folder but exclude t Another important option is `excludeAfterRemap`. By default, it is false, which might let excluded files through. If you exclude the files, and the instrumenter does not respect the `nyc.exclude` setting, then add `excludeAfterRemap: true` to tell `nyc report` to exclude files. See [test-apps/exclude-files](test-apps/exclude-files). +**Bundler virtual modules:** some bundlers generate virtual modules that are instrumented but don't exist on disk. For example, a [Stencil](https://stenciljs.com) app instrumented with `rollup-plugin-istanbul` reports coverage for `@lazy-browser-entrypoint?app-data=conditional`. When `nyc report` can't read the source, the report shows an “Unable to lookup source … ENOENT” page for that entry (older versions fail with `ENOENT`), and the entry still counts toward your totals. Exclude these modules by name and set `excludeAfterRemap: true`: + +```json +{ + "nyc": { + "exclude": ["**/@lazy-browser-entrypoint*"], + "excludeAfterRemap": true + } +} +``` + +Use the same approach for any other module name that shows up in `.nyc_output/out.json` without a matching file on disk. + ## Disable plugin You can skip the client-side code coverage hooks by setting the exposed `coverage` value to `false`. From a767432570df3f9d3739ded3e165ebbc84a5303f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 22:23:18 +0000 Subject: [PATCH 2/2] docs: use straight quotes and soften the older-version claim in the virtual modules note Refs #400 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WUv8r2pcQxLFLM65TTNcVW --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6636caf..5fd9425e 100644 --- a/README.md +++ b/README.md @@ -685,7 +685,7 @@ For example, if you want only to include files in the `app` folder but exclude t Another important option is `excludeAfterRemap`. By default, it is false, which might let excluded files through. If you exclude the files, and the instrumenter does not respect the `nyc.exclude` setting, then add `excludeAfterRemap: true` to tell `nyc report` to exclude files. See [test-apps/exclude-files](test-apps/exclude-files). -**Bundler virtual modules:** some bundlers generate virtual modules that are instrumented but don't exist on disk. For example, a [Stencil](https://stenciljs.com) app instrumented with `rollup-plugin-istanbul` reports coverage for `@lazy-browser-entrypoint?app-data=conditional`. When `nyc report` can't read the source, the report shows an “Unable to lookup source … ENOENT” page for that entry (older versions fail with `ENOENT`), and the entry still counts toward your totals. Exclude these modules by name and set `excludeAfterRemap: true`: +**Bundler virtual modules:** some bundlers generate virtual modules that are instrumented but don't exist on disk. For example, a [Stencil](https://stenciljs.com) app instrumented with `rollup-plugin-istanbul` reports coverage for `@lazy-browser-entrypoint?app-data=conditional`. When `nyc report` can't read the source, the report shows an "Unable to lookup source ... ENOENT" page for that entry (older versions could fail with `ENOENT`, see [#400](https://github.com/cypress-io/code-coverage/issues/400)), and the entry still counts toward your totals. Exclude these modules by name and set `excludeAfterRemap: true`: ```json {