site-kit-wp: WebFont global existing causes Google Charts with custom fontName to throw exception `Cannot read properties of null (reading '__eventTarget')`
Bug Description
We’ve had 3 reports of the following error after updating to the latest version of the plugin, 1.79.0
Cannot read properties of null (reading '__eventTarget')
This appears as a dashboard error, with more details below:
Cannot read properties of null (reading ‘__eventTarget’)
in GoogleChart
in div
in div
in UserDimensionsPieChart
in div
in Cell
in div
in ForwardRef
in div
in ForwardRef
in div
in div
in Widget
in WithWidgetSlug(Widget)
in DashboardAllTrafficWidget
in WhenAnalyticsActive(DashboardAllTrafficWidget)
in WidgetRenderer
in div
in Cell
in WidgetCellWrapper
in div
in ForwardRef
in div
in div
in ForwardRef
in WidgetAreaRenderer
in div
in WidgetContextRenderer
in DashboardMainApp
in DashboardEntryPoint
in RestoreSnapshots
in ErrorHandler
in StrictMode
in Root
Console Errors
TypeError: Cannot read properties of null (reading ‘__eventTarget’)
at gvjs_Zm (jsapi_compiled_default_module.js:412:29)
at Object.gvjs_Ym [as addListener] (jsapi_compiled_default_module.js:411:392)
at googlesitekit-modules-search-console-227f86b858fbc87c820e.js:31:11241
at Ui (googlesitekit-vendor-4167c42429c777851281.js:7:724946)
at va (googlesitekit-vendor-4167c42429c777851281.js:7:747869)
at t.unstable_runWithPriority (googlesitekit-vendor-4167c42429c777851281.js:7:767492)
at Mr (googlesitekit-vendor-4167c42429c777851281.js:7:692598)
at Yj (googlesitekit-vendor-4167c42429c777851281.js:7:744298)
at Lj (googlesitekit-vendor-4167c42429c777851281.js:7:734658)
at googlesitekit-vendor-4167c42429c777851281.js:7:692889
Steps to reproduce
The below are the only known steps to consistently recreate so far:
- Set up a new WP site, with SK set up and Google Analytics also connected
- Install and activate the Futurio Extra plugin
- Install and activate the Futurio theme
- Install one of the theme demos (Customizer > One Click Demo Import)
- After importing, revisit your SK dashboard. The error appears. If the error doesn’t appear, change the reporting period, or wait until cached response expire.
Note that upon refreshing the page with the error the dashboards loaded as expected in my case, as the reporting period switches back to the 28 day report, with the dashboard loading fine for this period
Screenshots

Additional Context
- Occurred after updating to SK 1.79.0
- The same occurs if uninstalling and reinstalling the plugin
- On a site where I could reproduce this error the only network requests on the Site Kit dashboard coming from the plugins highlighted above (in the steps to recreate) are web font related (example).
Impacted Users
- https://wordpress.org/support/topic/site-kit-encountered-an-error-67 | Open | SH info
- https://wordpress.org/support/topic/site-kit-encountered-an-error-68 | Open | SH info
- https://wordpress.org/support/topic/cannot-read-properties-of-null-reading-__eventtarget/ | Open | No SH info
Insights & Troubleshooting Checks performed
- Health Check & Troubleshooting plugin check
- Front end check (mixed content, minified content, combined JS)
- Incognito mode
- Checked users Site Health info, no identified causes
- Uninstalled and reinstalled plugin
- User confirmed no ““Critical errors”” in their Site Health status
- Attempted setup/viewing dashboards from another device
- Temporary disabled WAF rules at host level - including ModSecurity
- Checked site setup and dashboard from another WordPress site on the same hosting platform
- Reset Site Kit
- Reviewed error logs
- Reviewed XHR requests
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- When the Google Web Font loader script is loaded (eg. when the
WebFontJS global exists), Google Charts components should not throw an exception (causing the entire Dashboard to crash/error).
Implementation Brief
- Do not use the
fontName(eg. don’t supply a customfontNameproperty) to anyreact-google-chartscomponent when theWebFontglobal exists in JS. - Merge #5580.
Test Coverage
- None needed.
QA Brief
- Follow the steps to reproduce above, or use one of the PHP blocks in the first section of this comment: https://github.com/google/site-kit-wp/issues/5572#issuecomment-1190433825 in a custom plugin/
functions.phpfile on a site with Analytics setup (and with Analytics data). - There should be no error on the dashboard when using the latest
main/1.79.1. To verify the fix, make sure you can replicate the issue on the same site using Site Kit version1.79.0.
Changelog entry
- Fix an issue that could cause Site Kit’s dashboard to crash when a theme/plugin loads the Google Web Font Loader JS on Site Kit screens.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21
Looks like this is a compatibility issue with the Web Font Loader library.
The following is a snippet that can help reproduce the issue on your local machine even without futurio plugin and theme:
QA ❌
@tofumatt while testing, we found that it is still possible to raise the same error while toggling the date range. I wasn’t able to reproduce this at first but was able to eventually so this does not seem to happen consistently. Perhaps there is a bit of a race condition going on but this warrants a bit more testing and exploration.
So, this all seems to stem from the
WebFontglobal being written/available when React Google Charts tries to load a custom font for certain elements like the text in a pie chart slice. I think it only happens for content it renders inside an SVG, where we need to specify a custom font rather than it just relying on the plugin-wide fonts set here: https://github.com/google/site-kit-wp/blob/24e6a6368ce49d8eab433a052d1006c5aabe1e7a/assets/sass/config/_variables.scss#L242-L243This can be seen with Eugene’s code above; even just using:
will cause the bug to occur. In fact, even:
causes the bug.
This only happens when another plugin/theme/etc. loads the Google WebFont loader, possible another version, and only affects a few, small elements rendered by our Charts. I am totally unaware of the actual root cause because the errors are opaque and all of this code is third-party and a bit of a black box. But I have found a reliable fix that only needs to be used when the
WebFontglobal is loaded and it causes minimal issue.I think the best fix is to load those web fonts in Google Chart components as such:
It fixes the problem and only causes a few, small items to be rendered using Arial instead of Google Sans. Here’s the different for the UserDimensionsPieChart.
Google Sans
Arial
It’s not Analytics but the React Google Charts library, or our usage of it. Enabling Analytics renders the Google Charts
PieChartwithfontName: 'Google Sans Text'which is what’s causing the error.I’m still trying to figure out a cause, but as mentioned it might be best to disable custom fonts in our charts for now…
@tofumatt could you please help to troubleshoot this fonts issue? Assigning this ticket to you for now.
@jamesozzie Thanks for all that information. I can reproduce this issue locally and on an InstaWP site. Locally, it happens even when selecting the 7 days period - although on the InstaWP site it only occurred for 14 or 90 day periods. When I comment out the latest additions to GoogleChart, I do not get the error so this has been introduced in the last release. Not sure why those lines are an issue - haven’t dug deeper. Also not sure why this happens only with the install of Futurio either at this stage. But worth moving this to the Execution board as a bug to investigate further I guess?
I couldn’t reproduce the Data Errors - Invalid Credentials errors.
Just a quick comment that I’ve added steps to reproduce this within the main content of this issue, where I could recreate this with the Futurio theme and plugin. In my case the error appears on the 14 day or 90 day reporting period only. Testing ongoing.