Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateReleasesCount: Uncaught (in promise) TypeError: Cannot read property 'textContent' of null #901

Closed
sompylasar opened this issue Dec 21, 2017 · 7 comments
Labels
bug help wanted small Issues that new contributors can pick up

Comments

@sompylasar
Copy link
Contributor

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);
    }
  }
@fregante
Copy link
Member

What page did you see this on?

@sompylasar
Copy link
Contributor Author

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

@fregante fregante added the bug label Dec 22, 2017
@fregante
Copy link
Member

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

@sompylasar
Copy link
Contributor Author

@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.

@hkdobrev
Copy link
Contributor

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

@fregante
Copy link
Member

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

@fregante fregante added small Issues that new contributors can pick up help wanted labels Dec 29, 2017
@fregante
Copy link
Member

fregante commented Jan 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted small Issues that new contributors can pick up
Development

No branches or pull requests

3 participants