Github: Uncaught TypeError: Cannot read property 'startsWith' of undefined

Created on 19 Jun 2017  ·  9Comments  ·  Source: atom/github

_Edited by @Ben3eeE to add steps to reproduce_

  1. Right click on an untitled buffer
  2. Click on view unstaged changes or view staged changes

Note: There is a different exception now when doing these steps not the startsWith of undefined:

Uncaught (in promise) TypeError: Cannot read property 'toString' of undefined
    at Object.realpath (fs.js:1686:8)
    at Object.fs.realpath (ELECTRON_ASAR.js:338:25)
    at Promise (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app.asar\node_modules\universalify\index.js:13:12)
    at Promise (<anonymous>)
    at Object.defineProperty.value [as realpath] (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app.asar\node_modules\universalify\index.js:7:14)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:614:63
    at Generator.next (<anonymous>)
    at step (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:197)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:443
    at Promise (<anonymous>)
    at C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:138:105
    at RootController.viewChangesForCurrentFile (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:666:13)
    at RootController.viewStagedChangesForCurrentFile (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\node_modules\github\lib\controllers\root-controller.js:674:16)
    at CommandRegistry.handleCommandEvent (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\command-registry.js:384:49)
    at CommandRegistry.dispatch (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\command-registry.js:273:23)
    at AtomEnvironment.dispatchContextMenuCommand (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\atom-environment.js:1351:25)
    at EventEmitter.outerCallback (C:\Users\lineri\Desktop\issues\atom_master\atom\out\Atom x64\resources\app\src\application-delegate.js:346:53)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:197:7)

道中文是否可以???!
自己蹦出的错误,并不知道为什么
[Enter steps to reproduce:]

https://puu.sh/xn56P.gif

Atom: 1.18.0 x64
Electron: 1.3.15
OS: Ubuntu 16.04.2
Thrown From: github package 0.3.3

Stack Trace

Uncaught TypeError: Cannot read property 'startsWith' of undefined

At /usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:792

TypeError: Cannot read property 'startsWith' of undefined
    at RootController.viewChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:792:26)
    at RootController.viewUnstagedChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:812:16)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:3:65)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:166:25)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/src/atom-environment.js:1320:34)
    at EventEmitter.outerCallback (/usr/share/atom/resources/app/src/application-delegate.js:347:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -6:23 vim-mode-plus:repeat-find-reverse (input.hidden-input)
     -6:14.7.0 vim-mode-plus:insert-after (input.hidden-input)
  2x -6:14.3.0 editor:newline (input.hidden-input)
     -6:12.5.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -6:09.6.0 vim-mode-plus:repeat-find-reverse (input.hidden-input)
     -6:08.7.0 vim-mode-plus:substitute (input.hidden-input)
  2x -6:07.6.0 core:backspace (input.hidden-input)
     -6:07.2.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
 47x -5:24.4.0 vim-mode-plus:move-down (input.hidden-input)
 38x -5:22.3.0 vim-mode-plus:move-up (input.hidden-input)
     -0:20.5.0 vim-mode-plus:move-down (input.hidden-input)
 15x -0:20.3.0 vim-mode-plus:move-up (input.hidden-input)
 14x -0:18.8.0 vim-mode-plus:move-down (input.hidden-input)
 11x -0:17.6.0 vim-mode-plus:move-up (input.hidden-input)
     -0:16.5.0 vim-mode-plus:move-down (input.hidden-input)
     -0:15.8.0 github:view-unstaged-changes-for-current-file (div.lines)

Non-Core Packages

atom-beautify 0.30.1 
atom-react-autocomplete 0.1.10 
atom-ternjs 0.18.3 
autocomplete-js-import 1.4.0 
autocomplete-paths 1.0.5 
autoprefixer 3.7.0 
busy-signal 1.4.3 
color-picker 2.2.5 
emmet 2.4.3 
emmet-jsx-css-modules 1.0.0 
file-icons 2.1.7 
file-types 0.5.5 
git-plus 7.9.3 
intentions 1.1.2 
language-babel 2.66.0 
language-javascript-jsx 0.3.7 
linter 2.2.0 
linter-htmlhint 1.3.3 
linter-jshint 3.1.2 
linter-sass-lint 1.7.4 
linter-ui-default 1.6.1 
platformio-ide-terminal 2.5.1 
react-es6-snippets 0.3.0 
react-snippets 0.8.0 
relative-numbers 0.8.0 
vim-mode-plus 0.93.0 
triaged uncaught-exception

All 9 comments

Thanks for the report! We can best provide help in English since that allows more people to look at the issue.

Can you confirm a few things for us?

  • what were you doing at the time of the error?
  • is the error is reproducible?
  • if reproducible, do you see the error in safe mode (atom --safe)?

T.T sorry ,i try Reproduce the problem ,but ...
and i just Reinstall win7 , it has a problem on the hard disk;
i think if there is no other people have this error ,it mayebe because my old compter;
thank for your work

i just Reinstall win7 , it has a problem on the hard disk;

Oh interesting - not sure if that's actually causing the error but we can leave this open for a little while longer in case others run into the same error.

I got this error by right clicking in the blank space of a file and clicking view staged changes/view unstaged changes.

@XDelta

  • Can you clarify what you mean with the blank space of a file?
  • Is the error reproducible?
  • Can you record a gif or screencap of reproducing the error?

@XDelta Thank you :bowing_man: I can reproduce this using Atom 1.19.4

I got this error when I I try to see ionic info

user@acer:~/dreamhouse-mobile-ionic$ ionic info
:heavy_multiplication_x: Gathering environment info - failed!
TypeError: Cannot read property ‘startsWith’ of undefined

please advise

@flipmedia please report your issue to ionic.

Was this page helpful?
0 / 5 - 0 ratings