Skip to content

Fix JS error due to new version of Google Charts library #3132

@felixarntz

Description

@felixarntz

Bug Description

Several support requests have come in in the past few hours as noted by @bethanylang, with JS errors in the All Traffic widget, such as:

b.vr is not a function
    in GoogleChart
    in ContextProvider
    in Chart
    in div
    in GoogleChartV2
    in div
    in UserCountGraph
    in div
    in Cell
    in div
    in Row
    in div
    in Grid
    in div
    in div
    in Widget
    in WithWidgetSlug(Widget)
    in DashboardAllTrafficWidget
    in WhenAnalyticsActive(DashboardAllTrafficWidget)
    in div
    in Layout
    in div
    in Cell
    in LegacyDashboardAllTraffic
    in FilteredComponent
    in FilteredComponent
    in FilteredComponent
    in FilteredComponent
    in WithFilters(LegacyDashboardModule)
    in div
    in Row
    in div
    in Grid
    in div
    in DashboardApp
    in GoogleSitekitDashboard
    in RestoreSnapshots
    in ErrorHandler
    in Root

This is reported e.g. here:

Cannot read property 'ea' of undefined
    in GoogleChartV2
    in div
    in UserCountGraph
    in div
    in Cell
    in div
    in Row
    in div
    in Grid
    in div
    in div
    in Widget
    in WithWidgetSlug(Widget)
    in DashboardAllTrafficWidget
    in WhenAnalyticsActive(DashboardAllTrafficWidget)
    in div
    in Layout
    in div
    in Cell
    in LegacyDashboardAllTraffic
    in FilteredComponent
    in FilteredComponent
    in FilteredComponent
    in FilteredComponent
    in WithFilters(LegacyDashboardModule)
    in div
    in Row
    in div
    in Grid
    in div
    in DashboardApp
    in GoogleSitekitDashboard
    in RestoreSnapshots
    in ErrorHandler
    in Root

This is reported e.g. here:

As noted by @aaemnnosttv, a new "upcoming" version of the Google charts library was recently published, which somehow triggers these errors, as they were never reported before, and no update has been made to the Site Kit plugin meanwhile that could have caused this.


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

Acceptance criteria

  • Site Kit should control which version of the Google charts library is used instead of just saying "current" or "upcoming", which can cause issues like the one reported here.
    • By controlling the version in the plugin, we can occasionally update as needed with testing, instead of allowing the Google charts library to "update itself" across all Site Kit versions, potentially causing breakage.

Implementation Brief

Test Coverage

  • N/A

Visual Regression Changes

  • N/A

QA Brief

With Analytics active:

  • Do a hard refresh of the Site Kit dashboard.
  • Without this PR, there should be a JS error triggered (from the All Traffic widget).
  • With this PR, there should be no JS error and the widget should render as usual.

Changelog entry

  • Fix critical JS error due to a new version of the Google charts library being released, by locking to a specific version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0High priorityType: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions