Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MBehtemam opened this issue Jul 29, 2021 · 0 comments
Open

Comments

@MBehtemam
Copy link

MBehtemam commented Jul 29, 2021

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,
    };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant