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

Google Chart Library conflicts in the main WP dashboard widget #6350

Closed
jamesozzie opened this issue Dec 21, 2022 · 3 comments
Closed

Google Chart Library conflicts in the main WP dashboard widget #6350

jamesozzie opened this issue Dec 21, 2022 · 3 comments
Labels
P0 High priority Type: Bug Something isn't working

Comments

@jamesozzie
Copy link
Collaborator

jamesozzie commented Dec 21, 2022

Bug Description

Now that we load a mini dashboard that displays active users (within the main WordPress dashboard - #631) there are reports of conflicts with other plugins that also load such dashboard widgets. One example error is below:
Cannot read properties of undefined (reading 'Pe') | Support topic

image

image

hojWAaEn2n.mp4
Console errors
googlesitekit-wp-das…e602e2ccfa589.js:15 Caught an error: TypeError: Cannot read properties of undefined (reading 'Pe')
    at gvjs_Tn (jsapi_compiled_default_module.js:436:108)
    at gvjs_Q.gvjs_Sn (jsapi_compiled_default_module.js:435:185)
    at new gvjs_Q (jsapi_compiled_default_module.js:504:305)
    at GoogleChart.componentDidMount (googlesitekit-vendor…adccb98.js:7:294760)
    at ya (googlesitekit-vendor…adccb98.js:7:729533)
    at t.unstable_runWithPriority (googlesitekit-vendor…adccb98.js:7:749082)
    at Mr (googlesitekit-vendor…adccb98.js:7:674188)
    at Yj (googlesitekit-vendor…adccb98.js:7:725888)
    at Lj (googlesitekit-vendor…adccb98.js:7:716248)
    at googlesitekit-vendor…adccb98.js:7:674479 
{componentStack: '\n    in GoogleChart\n    in ContextProvider\n    in …   in ThemeProvider\n    in StrictMode\n    in Root'}
componentStack
: 
"\n    in GoogleChart\n    in ContextProvider\n    in Chart\n    in div\n    in GoogleChart\n    in div\n    in WPDashboardUniqueVisitorsChartWidget\n    in div\n    in WPDashboardWidgets\n    in div\n    in WPDashboardApp\n    in RestoreSnapshots\n    in ErrorHandler\n    in ThemeProvider\n    in StrictMode\n    in Root"
[[Prototype]]
: 
Object
constructor
: 
ƒ Object()
hasOwnProperty
: 
ƒ hasOwnProperty()
isPrototypeOf
: 
ƒ isPrototypeOf()
propertyIsEnumerable
: 
ƒ propertyIsEnumerable()
toLocaleString
: 
ƒ toLocaleString()
toString
: 
ƒ toString()
valueOf
: 
ƒ valueOf()
__defineGetter__
: 
ƒ __defineGetter__()
__defineSetter__
: 
ƒ __defineSetter__()
__lookupGetter__
: 
ƒ __lookupGetter__()
__lookupSetter__
: 
ƒ __lookupSetter__()
__proto__
: 
(...)
get __proto__
: 
ƒ __proto__()
set __proto__
: 
ƒ __proto__()

This is likely as we load Google Chart library scripts on the main WP dashboard. While other users reported the same or similar errors, these users are using different plugins. In my case I encountered it with the Analytics Insights for Google Analytics 4 (AIWP) plugin, with the steps to recreate below:

Steps to reproduce

  1. Setup a site with SK active (Analytics set up)
  2. Install and set up the Analytics Insights plugin (so that a WordPress main dashboard widget appears from this plugin)
  3. Visit the main WP dashboard. The error as per the screenshot (and recording) above appears

A potential workaround while we're working on this, could be to disable the the main WP dashboard if possible. I don't see a filter for this at present. Otherwise, if users who encounter this error, can view their Analytics data from the main Site Kit dashboard.

Additional information

Impacted users / Support topics & possible other errors output (all since SK version 1.90.0 was shipped)

Cannot read properties of null (reading '0')

Cannot read properties of undefined (reading ‘Pe’)

`gvjs_cq. Call is not a function

Others


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

Acceptance criteria

  • The chart for "Unique visitors over the last 28 days" in Site Kit's summary widget on the WP dashboard (WP dashboard widget show daily uniques #631) should be removed
    Note: this is temporary and will be restored in a near-future release.
    • Only the chart's presence in the summary widget should be removed; the component itself should remain

Implementation Brief

  • Remove the rendered WPDashboardUniqueVisitorsChartWidget from WPDashboardWidgets

Test Coverage

  • No changes should be needed, except perhaps VRT reference images

QA Brief

  • This issue addresses a conflict on the WP dashboard involving other plugins which also load Google charts
  • The Site Kit Summary WP dashboard widget should continue to load and display as normal with plugins that currently conflict with the 1.90.0 version

Changelog entry

  • Fix a compatibility issue by temporarily removing the "Unique visitors over the last 28 days" chart from the "Site Kit Summary" WordPress dashboard widget.
@felixarntz
Copy link
Member

@aaemnnosttv Do we already have a follow up issue to restore the widget? So that it doesn't get lost. What should be our prerequisites before restoring it?

@aaemnnosttv
Copy link
Collaborator

@felixarntz we do not have that yet, I can open that now. I was thinking #6346 would be sufficient for doing that. What do you think?

@wpdarren
Copy link
Collaborator

QA Update: ✅

  • The Site Kit Summary WP dashboard widget continues to load and display as normal with plugins that currently conflict with the 1.90.0 version, i.e. Analytics Insights for Google Analytics 4 (AIWP) plugin.
  • The graph no longer appears which is expected as we have temporarily removed this.
  • No errors appear in the console or Site Kit widget on the WP dashboard, that is related to Site Kit.
  • Had a quick look at the charts on the main and entity dashboard and they load fine but will complete regression testing before releasing 1.90.1 hotfix.
Screenshots

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants