Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c8 fails with undefined is not iterable error #543

Open
jasonpolites opened this issue Sep 21, 2024 · 1 comment
Open

c8 fails with undefined is not iterable error #543

jasonpolites opened this issue Sep 21, 2024 · 1 comment

Comments

@jasonpolites
Copy link

  • Version: v20.12.2
  • Platform: Ubuntu 20.04.6 LTS (actually WSL, but the uname output is mostly useless)

I'm trying to replace nyc due to this bug, but out of the box c8 seems to fail with the following error:

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at RangeTree.fromSortedRanges (<REDACTED>/node_modules/@bcoe/v8-coverage/dist/lib/range-tree.js:27:39)
    at normalizeFunctionCov (<REDACTED>/node_modules/@bcoe/v8-coverage/dist/lib/normalize.js:74:41)
    at Object.deepNormalizeScriptCov (<REDACTED>/node_modules/@bcoe/v8-coverage/dist/lib/normalize.js:59:9)
    at mergeScriptCovs (<REDACTED>/node_modules/@bcoe/v8-coverage/dist/lib/merge.js:59:21)
    at mergeProcessCovs (<REDACTED>/node_modules/@bcoe/v8-coverage/dist/lib/merge.js:34:21)
    at Report._getMergedProcessCov (<REDACTED>/node_modules/c8/lib/report.js:336:12)
    at Report.getCoverageMapFromAllCoverageFiles (<REDACTED>/node_modules/c8/lib/report.js:245:27)
    at Report.run (<REDACTED>/node_modules/c8/lib/report.js:84:31)
    at exports.outputReport (<REDACTED>/node_modules/c8/lib/commands/report.js:42:16)
    at <REDACTED>/node_modules/c8/bin/c8.js:30:15

My npm script command is:

"coverage": "c8 --reporter=html --reporter=text mocha"

I'm not sure what else I can provide, or where to look next 🤷‍♂️

@jasonpolites
Copy link
Author

Issue also found here: vitest-dev/vitest#5329, corresponding to this PR: bcoe/v8-coverage#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant