himynameisdave / git-labelmaker

:flags: Manage your GitHub labels from the command line!
MIT License
574 stars 33 forks source link

TypeError: Cannot read property 'split' of undefined #66

Closed marcusmoore closed 7 years ago

marcusmoore commented 8 years ago

I've previously run git-labelmaker and it worked just fine but when I ran it today I needed to use a new token since I forgot my password. After I entered the new token and a master password I got the error [TypeError: Cannot read property 'split' of undefined]. I uninstalled and reinstalled git-labelmaker and it didn't fix the issue. I tried diving into the source to see what might be happening here but I'm honestly not too sure...

node version: 5.11.1 npm version: 3.9.5

Any thoughts?

dwoodiwiss commented 8 years ago

My guess would be that the repos URL format is possibly causing the issue. The split error is most likely coming from here.

Some GitHub URLs contain : which might not be getting picked up by this package - which is used in this project.

himynameisdave commented 8 years ago

@dwoodiwiss thanks for looking into this, I think you may be correct in which case I will file & fix it in node-github-url-from-git.

@marcusmoore do you know what github repo (or better the github url) you were experiencing the issue with?

marcusmoore commented 8 years ago

Thanks for looking into this. I went back and looked at my dev log for the day and here's my notes:

touch labels.json
sublime labels.json

# paste in labels and save
# forgot my master password...
# deleted old token from here: https://github.com/settings/tokens
# generated new token with repo access...
git-labelmaker
# Chose to create new token
# Got error `[TypeError: Cannot read property 'split' of undefined]`...

# remove git-labelmaker
npm uninstall -g git-labelmaker

# and install again...
npm i -g git-labelmaker

# enter access token and master password and got error again...

The remote repo that I was intending to add labels to had a - in the url though. I'm not sure if that could be the issue?

pmahnke commented 7 years ago

I have this same issue with a repo with a dash '-' in the name as well...

koobitor commented 7 years ago

I try to change remote form ssh to https.

screen shot 2559-09-12 at 11 20 10 pm
himynameisdave commented 7 years ago

I've added some proper error handling, and as far as I can tell the node-github-url-from-git package handles all of the standard github urls. If there are anymore issues/if you are not seeing meaningful errors, let me know and we can re-investigate.

Otherwise feel free to submit tickets to node-github-url-from-git with your specific test cases/git urls that are failing 👍