imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.32k stars 2.62k forks source link

Weird github.js behavior #252

Closed argent-smith closed 12 years ago

argent-smith commented 12 years ago

Hello!

I've just installed Octopress and see a weird thing: Github aside doesn't work and Chromium's development tools say: github.js: 18 Uncaught TypeError: Cannot read property 'repositories' of undefined; later on I've found that data variable is undefined in this scope.

Sincerely, Pavel.

fhemberger commented 12 years ago

Hmm, is your github username spelled correct in _config.yml? I added a patch so github.js doesn't throw an error when there's a problem receiving repositories.

argent-smith commented 12 years ago

Yes, it is correct. I'll check the thing with this recent patch.

argent-smith commented 12 years ago

No error now but still no result displayed. You can check my config at argent-smith/octopress

fhemberger commented 12 years ago

Hmm. Maybe it's because of the single quotes around your username? If you're using Firefox or Chrome, please check the development console for a GET request to: https://github.com/api/v2/json/repos/show/argent-smith?callback=?

argent-smith commented 12 years ago

I can repeat without them (actually, I've inserted them just before writing the last message), no difference. However, I'll do this so you could see.

Again, the source is at my octopress repo, the result runs on heroku.com as http://argentoff.net

For the result of the testing URL, see Gist 1323221

fhemberger commented 12 years ago

Hmm, this is strange indeed. Request result is fine, this need more investigating.

fhemberger commented 12 years ago

@argent-smith: Ok, I found the reason. It has nothing to do with Octopress but with an illegal character in the description of one of your repositories:

        {
        "description": "YARD is a Ruby Documentation tool (Yay!)\n\nYARD is a documentation generation tool for the Ruby programming language.
 It enables the user to generate consistent, usable documentation that can be
 exported to a number of formats very easily, and also supports extending for
 custom Ruby constructs such as custom class level definitions.",
        "url": "https://github.com/argent-smith/yard",
        "watchers": 1,
        "created_at": "2011/05/20 09:37:19 -0700",
        "forks": 0,
        "has_wiki": true,
        "homepage": "http://yardoc.org",
        "fork": true,
        "language": "Ruby",
        "size": 4160,
        "private": false,
        "has_issues": false,
        "name": "yard",
        "owner": "argent-smith",
        "open_issues": 0,
        "pushed_at": "2011/05/18 16:39:26 -0700",
        "has_downloads": true
    },

As soon as I empty the description field, this is parsed as valid JS. Here is the explanation to the problem: http://timelessrepo.com/json-isnt-a-javascript-subset

I tried to trim it down a bit:

 ({"description": "for
 custom Ruby constructs such as custom class level definitions."})
SyntaxError: Unexpected token ILLEGAL

 ({"description": "custom Ruby constructs such as custom class level definitions."})
Object

I'm not sure, whether it's exactly the invisible character described in the article above, but something is there.

argent-smith commented 12 years ago

Thanks a lot! I'll find and purge it.

fhemberger commented 12 years ago

I'll also sent an email to GitHub so they can look into the issue. These chars should be filtered by the API.

argent-smith commented 12 years ago

Thanks for that!