git-stats
git-stats copied to clipboard
TypeError: Cannot set property 'NaN' of undefined
System:
- Windows 10
- NodeJS v6.9.5
User@DesktopPC MINGW64 /e/Git/GitStatsTest (branch/test)
$ git-stats -a
C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-graph\lib\index.js:63
self.graph[settings.center.y][settings.center.x] = settings.marks.center;
^
TypeError: Cannot set property 'NaN' of undefined
at new CliGraph (C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-graph\lib\index.js:63:54)
at new CliCircle (C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-circle\lib\index.js:35:18)
at CliPie.toString (C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-pie\lib\index.js:170:18)
at C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:612:87
at C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:548:9
at LimitIt.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\gry\lib\index.js:86:17)
at C:\Users\User\AppData\Roaming\npm\node_modules\git-stats\node_modules\limit-it\lib\index.js:138:20
at ChildProcess.exithandler (child_process.js:197:7)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
Whoups! Debugging is welcome since I do not have a Windows machine around...
I put a console.log above the offending line.
console.log(settings);
self.graph[settings.center.y][settings.center.x] = settings.marks.center;
It seems the settings.center children nodes are NaN for some reason, could be a Windows bug?
{ width: NaN,
height: NaN,
marks:
{ hAxis: ' ',
vAxis: ' ',
center: ' ',
point: ' ',
rightArrow: ' ',
topArrow: ' ',
background: ' ' },
center: { x: NaN, y: NaN }, // <- Here
aRatio: 1 }
Whoups!
This is the place here the centers are set: https://github.com/IonicaBizau/node-cli-graph/blob/4f3acc270e5718ebc8b087c750b369551976df56/lib/index.js#L49-L55
i have the same problem
It looks like the defaults aren't being merged with the options. settings = self.options = Ul.deepMerge(options, CliGraph.defaults)
For me it happens in the git bash. In the cmd.exe it looks ok. Can anyone confirm that?
@mariuszjamro I can confirm the -a works in cmd.exe but not in Git Bash, however the coloring/scale is broken in cmd.exe.
I confirm this issue under Windows 7.
Also confirm using cmd.exe produces no usable output even not with --disable-ansi
git-bash ouput is not same as screenshots on main git page, but it's ok.