Skip to content

chart.removeListener is not a function after upgrade the Webpack 4 to 5 #95

Description

@MBehtemam

my project not a create-react-app project but a custom one, after we upgrade Webpack V4 to V5 and also we removed the bable/pollyfill this error happened. the only way to remove the error is that we should remove listeners from chart options. so if the the chart doesn't have listeners it works but if we add it again we will see this error.
image

and here is our chart option :

let options = {
      ...CHARTS_GENERAL_CONFIG,
      type: 'serial',
      balloon: CHARTS_TOOLTIP_CONFIG,
      rotate: true,
      marginRight: 32,
      graphs: [
        {
          balloonText: renderToString(
            <ChartTooltip
              title='[[category]]'
              metric={this.props.valueTitle}
              value={balloonValue}
              valueColor={CHARTS_CONSTANTS.DEFAULT_CHART_COLOR}
            ></CSChartTooltip>,
          ),
          balloonColor: CHARTS_CONSTANTS.DEFAULT_CHART_BORDER_COLOR,
          fillColors: CHARTS_CONSTANTS.DEFAULT_CHART_COLOR,
          fillAlphas: 1,
          columnWidth: 0.5,
          lineThickness: 0,
          title: this.props.valueTitle,
          type: 'column',
          valueField: this.props.valueField,
          urlField: 'url',
        },
      ],
      categoryField: this.props.categoryField,
      categoryAxis: {
        ...AXIS_LABEL_TRUNCATION,
        color: CHARTS_CONSTANTS.DEFAULT_TEXT_COLOR,
        listeners: [
          {
            event: 'clickItem',
            method: event => this.clickItemEvent(event),
          },
        ],
      },
      valueAxes: [
        {
          integersOnly: true,
          stackType: 'regular',
        },
      ],
      dataProvider: data,
    };

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions