istanbuljs / nyc

the Istanbul command line interface

Home Page:https://istanbul.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReferenceError: cov_8wmh7etf0 is not defined

S-N-O-R-L-A-X opened this issue · comments

Link to bug demonstration repository

https://github.com/S-N-O-R-L-A-X/nyc-question

Expected Behavior

no error and the code runs smoothly.

Observed Behavior

undefined:3
return function f(a){cov_8wmh7etf0().f[0]++;cov_8wmh7etf0().s[0]++;if(a==="aa"){cov_8wmh7etf0().b[0][0]++;cov_8wmh7etf0().s[1]++;return"hit";}else{cov_8wmh7etf0().b[0][1]++;cov_8wmh7etf0().s[2]++;return"not hit";}}
                     ^

ReferenceError: cov_8wmh7etf0 is not defined
    at f (eval at findInput (E:\Github\nyc-question\test\findInput.js:7:73), <anonymous>:3:22)    
    at Object.findString (E:\Github\nyc-question\test\findString.js:5:102)
    at findInput (E:\Github\nyc-question\test\findInput.js:7:128)
    at Object.<anonymous> (E:\Github\nyc-question\test\specific-string.js:5:246)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Module.replacementCompile (C:\Users\SNORLAX\AppData\Roaming\npm\node_modules\nyc\node_modules\_append-transform@2.0.0@append-transform\index.js:60:13)
    at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Object.<anonymous> (C:\Users\SNORLAX\AppData\Roaming\npm\node_modules\nyc\node_modules\_append-transform@2.0.0@append-transform\index.js:64:4)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

Troubleshooting steps

  1. clone the repo
  2. run npm install
  3. run nyc --reporter=text --report-dir=./nyc_output node specific-string.js in /test
  • [no nyc config] still occurring when I put cache: false in my nyc config

Environment Information

# paste the output here
System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz
    Memory: 7.02 GB / 15.94 GB
  Binaries:
    Node: 14.17.0 - E:\node\node.EXE
    npm: 6.14.13 - E:\node\npm.CMD

Sorry, I found some similar issues in closed.

Sorry, I found some similar issues in closed.

It looks like #1327, but I think they are not the same.