Skip to content

GlAreaChart: Event listener removal fails due to chart instance being null during beforeDestroy lifecycle hook

Background

It was discovered in gitlab-org/gitlab!201178 (comment 2688710276) that upon applying filters that results in no data, then clearing those filters, the chart throws a ReferenceError when trying to remove event listeners in the beforeDestroy lifecycle hook. We likely need to first implement a safety check for the chart instance beforehand.

Screen Recording 2025-08-14 at 1.39.53 PM.mov