istanbuljs / nyc

the Istanbul command line interface
https://istanbul.js.org/
ISC License
5.61k stars 360 forks source link

Cannot read property 'decl' of undefined #1432

Open firewash opened 3 years ago

firewash commented 3 years ago

Expected Behavior

HTML report generated correctly when merging some coverage JSON .

Observed Behavior

Error in tsx file: Cannot read property 'decl' of undefined

image

Troubleshooting steps

repetition steps:

  1. put the first coverage-final.json as unit.json from Jest unit test in .nyc_output
  2. put the second coverage json as e2e.json from e2e test ( code instrumented by babel-plugininstanbul ) in .nyc_output
  3. run 'nyc report --reporter=html'

Environment Information

nyc@15.1.0

firewash commented 3 years ago

addtional info :

  1. run 'nyc report --reporter=json' to merge two file, and genarate a 'coverage-final.json'. the value of line 27, 28 are 'null' image

  2. stack info image

  3. others infomations: e2e.json is generated by nyc merging some origin coverage data from "window. _ coverage _". It contains inputSourceMap properies.

tommyc38 commented 1 year ago

Did anyone figure out why this is happening?