Refined-github: updateReleasesCount: Uncaught (in promise) TypeError: Cannot read property 'textContent' of null

Created on 22 Dec 2017  路  7Comments  路  Source: sindresorhus/refined-github

Uncaught (in promise) TypeError: Cannot read property 'textContent' of null
    at updateReleasesCount (content.js:1605)
    at add_releases_tab (content.js:1622)
    at enableFeature (content.js:806)
    at <anonymous>
  function updateReleasesCount() {
    if (isRepoRoot()) {
      // >>>>>>>>>>>>>>>>>>>> THERE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      const releasesCount = select_dom_default()('.numbers-summary a[href$="/releases"] .num').textContent.trim();
      localCache = {
        [repoKey]: releasesCount
      };
      browser.storage.local.set(localCache);
    }
  }
bug good first issue help wanted

All 7 comments

What page did you see this on?

@bfred-it This was on a private repo, but I reproduced here: https://github.com/sindresorhus/refined-github/tree/faster-reviews?files=1

Wow, how did you get there? Even GitHub has bugs on that page

screen shot 2017-12-22 at 10 44 50

Anyway, updates are needed to page-detect.js

@bfred-it Yes, I noticed (even checked whether this or the issue links extension is causing that). A colleague sent me the link to his branch (in our private repo). I just replaced our org name, repo name, and branch name with this repo's ones.

This is reproducible even on a repo homepage without the tree segment: https://github.com/sindresorhus/refined-github?files=1

https://github.com/sindresorhus/refined-github?files=1

I gave it a further look and I think that the two features need a more specific check (like isRepoRoot) and isRepoRoot needs to be updated to check for files=1

Also on empty repos: https://github.com/bfred-it-obsolete/empty

It'd be a good idea to add a check for that missing element, on top of the page-detect changes I suggested.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexanderadam picture alexanderadam  路  3Comments

mareksuscak picture mareksuscak  路  3Comments

MilesBHuff picture MilesBHuff  路  3Comments

olso picture olso  路  3Comments

yakov116 picture yakov116  路  3Comments