site-kit-wp: JavaScript error: Cannot read property 'clearPermissionScopeError' of null

Bug Description

Reported in a support topic, a user encountered this error upon activation:

Cannot read property 'clearPermissionScopeError' of null
    in PermissionsModal
    in ErrorHandler
    in Root

Not reproducible as of yet/ awaiting information from user for more context.

Additional Context

  • PHP Version:
  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Plugin Version [e.g. 22]
  • Device: [e.g. iPhone6]

Related support topic: https://wordpress.org/support/topic/site-kit-encountered-an-error-clearpermissionscopeerror/


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

Visual Regression Changes

QA Brief

Changelog entry

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28

Most upvoted comments

I did a review of the below support topics with users who experienced these errors:

Additional insights:

  • 5/7 now resolved, as confirmed by users
  • Various fixes, uninstalling & reinstalling, checking incognito.
  • Unsure whether the remaining 2 experience this issue, no recent response.
  • No common traits from inspecting provided Health Information
  • 3/4 Site Health information reports provided have All in One WP Migration active, suggesting Site Kit may have been setup on another domain before migration (this was also evident from another report)
  • 2/4 Site Health information reports have LiteSpeed cache active, which does have configurations that can result in non reporting of data although no reports of setup being impacted
  • Started occurring in SK 1.22.0, the most recent support topic was from SK 1.26.0
  • Different hosting providers
  • 2/4 have additional htaccess rules

@abdullah1908 @bethanylang I suspect issues have have arose between migrating a site, with the new site maybe contain invalid tokens or references to the old site. I can’t be sure. Maybe it’s worth escalating to see if L2 have any additional insights.

@jamesozzie Thanks for following up!

Given that this appears to be an edge case and we don’t have much info, I’m going to close. If we do see it again in the future, we can open a new issue and refer back to this one.

Will do @aaemnnosttv. Some console errors from the above topics below. In addition once user provided a video, with the video an error appears in the Site Kit homepage widget that their account isn’t able to access Google account data.

image

image

@jamesozzie @bethanylang – any time a user reports an error like this, it’s always a good idea to ask for a screenshot of the browser console, if possible (assuming it’s reproducible for the user). I’ve noticed some other threads/issues have this.

This could be possible if the user had something in place which blocked one of our JS files from being loaded (either in browser, or something on the server perhaps). This isn’t something we can deduce from Site Health info or error messages alone though. A content security policy (as referenced above) could cause problems but that would likely be more for all of Site Kit rather than a particular action or screen.

For anyone able to connect using an incognito window, that seems to indicate a browser extension blocking something. This would be easier to confirm if we could see the full output in the console though.

Definitely a bit of an edge case. Not much we can really do without more information unfortunately.

@jamesozzie @abdullah1908 Looks like an uninstall/reinstall did the trick for the most recent user who experienced this issue. Worth doing one more try at replicating?

Similar report from one user in the support forums. Awaiting response regarding additional information.

Some useful insights provided by one user on the WordPress support forums. Changes were made to their Content Security Policy on their NginX server in order to proceed.