nyc icon indicating copy to clipboard operation
nyc copied to clipboard

nyc merge for large number of files throws "Invalid string length" error

Open parvez opened this issue 2 years ago • 0 comments

We run 20+ parallel runs of cypress that generate 20 different coverage${ID}-final.json stored in cypress/coverage

Expected Behavior

$(npm bin)/nyc merge cypress/coverage cypress/coverage/coverage-final.json should merge them into a single coverage file without issue.

Observed Behavior

$(npm bin)/nyc merge cypress/coverage cypress/coverage/coverage-final.json throws this error:

RangeError: Invalid string length

Likely issue

Might be happening due to https://github.com/nodejs/node/issues/35973 and thus lowering the number of runs to 14 works as the size of the json is lower than 500MB

Screen Shot 2022-03-14 at 2 21 23 PM

parvez avatar Mar 14 '22 21:03 parvez