Repository navigation
docs: explain how to exclude bundler virtual modules from reports - #1008
Merged
jennifer-shehane merged 2 commits intoNov 1, 2026
Merged
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r2pcQxLFLM65TTNcVW
…irtual modules note Refs #400 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r2pcQxLFLM65TTNcVW
|
🎉 This PR is included in version 4.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Additional details
#400 asked for a Stencil example. The one concrete failure in the thread was
cy.task('coverageReport')hittingENOENTon@lazy-browser-entrypoint?app-data=conditional. That's a Rollup virtual module: it gets instrumented, but no file exists on disk for it. The plugin passes every coverage key tonyc reportand doesn't filter by whether the file exists, so the problem still applies today. What has changed is how it shows up. With nyc 18, the report no longer crashes. Instead you get an "Unable to lookup source ... ENOENT" page for that entry, and the entry still counts toward the totals.This PR adds a short Bundler virtual modules note under "Exclude files and folders" in the README, with a snippet:
{ "nyc": { "exclude": ["**/@lazy-browser-entrypoint*"], "excludeAfterRemap": true } }A few decisions worth flagging for review:
maxkarkowski/stencil-example) doesn't show up in GitHub search anymore, and I didn't find another Stencil example repo.excludeAfterRemap: trueis required, not optional. The plugin defaults it tofalse, and in that caseexcludealone leaves the virtual module in the report.ENOENTcrash comes from the thread. I didn't reproduce it, so the README links to [Feature request] Example for stenciljs #400 rather than stating it as tested.Steps to test
.nyc_output/out.jsonwith two entries: one real instrumented file, and a copy of it whosepathis@lazy-browser-entrypoint?app-data=conditional.npx nyc report --reporter=lcovwith{"excludeAfterRemap": false}in.nycrc.coverage/lcov.infolists bothSF:entries, andcoverage/lcov-report/root/has an "Unable to lookup source" page..nycrcwith the README snippet's options and rerun. Only the real file remains.npm run build,npm testandnpm run format:checkpass locally. I couldn't runnpm run check:markdownlocally because my environment blocks outbound link checks, so CI will be the first to check the newstenciljs.comand #400 links.How has the user experience changed?
No change. This is a README-only update, and the plugin behaves the same in a Cypress run.
Generated by Claude Code
Note
Low Risk
README-only change with no code or configuration defaults modified in the plugin.
Overview
Adds a Bundler virtual modules note in the README under file/folder exclusion, addressing #400.
It explains that instrumented Rollup/Stencil-style virtual paths (e.g.
@lazy-browser-entrypoint?app-data=conditional) can appear in coverage with no on-disk source, producing Unable to lookup source … ENOENT pages while still affecting totals. The doc recommends excluding those module names vianyc.excludeand settingexcludeAfterRemap: true, with a concrete JSON example and a reminder to apply the same pattern for any phantom keys in.nyc_output/out.json.No runtime or plugin behavior changes—documentation only.
Reviewed by Cursor Bugbot for commit a767432. Bugbot is set up for automated code reviews on this repo. Configure here.