Skip to content

Uncaught TypeError: Cannot read properties of undefined (reading 'elements') #466

@flolanger

Description

@flolanger

Currently, I'm experiencing the following when I'm registering the Plugin:

Uncaught TypeError: Cannot read properties of undefined (reading 'elements')
    at draw (vendor.js?id=3b013313f9db684a6c3b:14598)
    at Object.beforeDraw (vendor.js?id=3b013313f9db684a6c3b:14473)
    at callback (vendor.js?id=3b013313f9db684a6c3b:10909)
    at PluginService._notify (vendor.js?id=3b013313f9db684a6c3b:5028)
    at PluginService.notify (vendor.js?id=3b013313f9db684a6c3b:5015)
    at Chart.notifyPlugins (vendor.js?id=3b013313f9db684a6c3b:6091)
    at Chart.draw (vendor.js?id=3b013313f9db684a6c3b:5802)
    at vendor.js?id=3b013313f9db684a6c3b:145
    at Map.forEach (<anonymous>)
    at Animator._update (vendor.js?id=3b013313f9db684a6c3b:123)

My implementation (just like in the docs):

import { Chart } from 'chart.js';
import annotationPlugin from 'chartjs-plugin-annotation';

Chart.register(annotationPlugin);

I'm using both ChartJS and Plugin-Annotation latest Version:

  • ChartJS: 3.5.1
  • chartjs-plugin-annotation: 1.0.2

Any ideas on how to fix this? Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions