Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

"Cannot read property slice of null" when trying to set an access token #107

Closed
swsnr opened this issue May 19, 2017 · 9 comments
Closed
Assignees

Comments

@swsnr
Copy link

swsnr commented May 19, 2017

When I try to set the access token I get the above error. The Developer Tools console has the following to say on this error:

Developer Tools Console log

shell.ts:474 Cannot read property 'slice' of null: TypeError: Cannot read property 'slice' of null
    at /Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:50:39
    at Generator.next (<anonymous>)
    at fulfilled (/Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:4:58)
e.onUnexpectedError @ shell.ts:474
(anonymous) @ shell.ts:434
e.onUnexpectedError @ errors.ts:68
o @ errors.ts:88
(anonymous) @ winjs.base.js:43
(anonymous) @ winjs.base.js:38
winjs.base.js:45 WARNING: Promise with no error callback:92
winjs.base.js:46 Objecterror: Error: Cannot read property 'slice' of null
    at /Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:50:39
    at Generator.next (<anonymous>)
    at fulfilled (/Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:4:58)message: "Cannot read property 'slice' of null"name: "TypeError"stack: "TypeError: Cannot read property 'slice' of null↵    at /Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:50:39↵    at Generator.next (<anonymous>)↵    at fulfilled (/Users/sebastian.wiesner/.vscode/extensions/KnisterPeter.vscode-github-0.15.1/out/src/git.js:4:58)"__proto__: Objectexception: nullhandler: undefinedid: 92parent: undefinedpromise: n.Class.derive._oncancel__proto__: Object
messageService.ts:125 Cannot read property 'slice' of null
e.doShow @ messageService.ts:125
e.show @ messageService.ts:104
e.resume @ messageService.ts:63
(anonymous) @ workbench.ts:856
e.invoke @ callbackList.ts:63
e.fire @ event.ts:123
(anonymous) @ quickOpenController.ts:513


I'm not sure how to debug this issue further, and would appreciate any hints :) If you need further information please tell me.

@KnisterPeter
Copy link
Owner

@lunaryorn the token is already set and the problem is then in the git access. Can you tell me the git url you checked out your project with? Like git@github:username/repo.git.
The parsing of this url to extract username and repo fails.

@swsnr
Copy link
Author

swsnr commented May 22, 2017

@KnisterPeter Where can I see the token? I didn't find anything in settings.json

The URL is github.com:lunaryorn/xkpwgen.hs.git, but it fails with git@github.com:lunaryorn/xkpwgen.hs.git too.

KnisterPeter added a commit that referenced this issue May 22, 2017
@KnisterPeter
Copy link
Owner

The token is stored in the global settings of vscode since it should work for more than the current workspace.

The bug will be fixed in the next release I publish later today. Thanks for reporting.

KnisterPeter added a commit that referenced this issue May 22, 2017
@KnisterPeter
Copy link
Owner

Released in 0.16

@swsnr
Copy link
Author

swsnr commented May 22, 2017

@KnisterPeter Thanks a lot, works now ❤️ 👍

@swsnr
Copy link
Author

swsnr commented May 22, 2017

PS: I noticed that the git@ part is mandatory for a remote to be recognised as Github remote.

Could you perhaps make it optional? I set the username in my SSH configuration. There's no other user name you could use with Github's SSH server, so it's convenient to have it set as default.

@KnisterPeter
Copy link
Owner

Would be possible if restricted to github.com as hostname.
Could you please file a new issue for that?

@swsnr
Copy link
Author

swsnr commented May 22, 2017

Ah, I didn't think of Github Enterprise.

I'll open a new issue.

@swsnr
Copy link
Author

swsnr commented May 22, 2017

I opened #110

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

No branches or pull requests

2 participants