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

TypeError: Cannot set property 'NaN' of undefined #114

Open
kdavis opened this issue Feb 2, 2017 · 8 comments
Open

TypeError: Cannot set property 'NaN' of undefined #114

kdavis opened this issue Feb 2, 2017 · 8 comments

Comments

@kdavis
Copy link

kdavis commented Feb 2, 2017

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)
@IonicaBizau
Copy link
Owner

Whoups! Debugging is welcome since I do not have a Windows machine around...

@IonicaBizau IonicaBizau added the bug label Feb 3, 2017
@kdavis
Copy link
Author

kdavis commented Feb 3, 2017

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 }

@IonicaBizau
Copy link
Owner

@yangjiebeijing
Copy link

i have the same problem

@kdavis
Copy link
Author

kdavis commented Feb 15, 2017

It looks like the defaults aren't being merged with the options. settings = self.options = Ul.deepMerge(options, CliGraph.defaults)

@mjamro
Copy link

mjamro commented Jan 15, 2018

For me it happens in the git bash. In the cmd.exe it looks ok. Can anyone confirm that?

@robodude666
Copy link

@mariuszjamro I can confirm the -a works in cmd.exe but not in Git Bash, however the coloring/scale is broken in cmd.exe.

@codexp
Copy link

codexp commented Mar 14, 2018

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.

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

No branches or pull requests

6 participants