darcyclarke / Repo.js

:page_facing_up: A plugin to embed Github repos on your site
MIT License
911 stars 83 forks source link

Type Error: Cannot read property 'length' of undefined #45

Closed tacocat777 closed 2 years ago

tacocat777 commented 5 years ago

Trying to implement this awesome script on my github pages found here: https://tacocat777.github.io

I followed instructions from this article (https://www.codediesel.com/javascript/easily-embed-a-github-repo-onto-your-site/), but can't seem to get it to work.

It gets stuck loading and the console has this error output: akjsdf

tacocat777 commented 5 years ago

Anyway I could see an example/implementation of this please?

Oct4Pie commented 2 years ago

Since the default branch is no longer master, you should add branch: "main"

<script>
    $(function() {
        $('#id').repo({
            user: 'user',
            name: 'repo-name',
            branch: 'main',
        });
    });
</script>