I'm using all the latest versions of create-react-app, react, webpack, amcharts. I've implemented a amchart component with webpack, published that to our local npm registry and tried to import it in the create-react app. When I'm using the amchart component it is throwing an error like this
webpackHotDevClient.js:45 Uncaught TypeError: Cannot read property 'dispose' of undefined
I've tried with different versions of amcharts 4 These are the versions that I've used
- create-react-app - v3.0.1
- amcharts - v4.5.2
- node - v10.16.0
- npm - v6.9.0
//import packages
import React from "react";
//import components
import AMChart from "amchart";
class SomeComponent extends React.Component {
render() {
return (
<div className="chart-container">
<AMChart {...some props} />
</div>
);
}
}
Uncaught TypeError: Cannot read property 'dispose' of undefined
at Object../node_modules/react-dev-utils/webpackHotDevClient.js (webpackHotDevClient.js:45)
at a (amchart.js:25)
at Object.0 (themes.css?9e0d:45)
at a (amchart.js:25)
at Module.<anonymous> (amchart.js:37186)
at a (amchart.js:25)
at push.../amchart/dist/amchart.js (amchart.js:136)
at Object.../amchart/dist/amchart.js (amchart.js:137)
at __webpack_require__ (bootstrap:786)
at fn (bootstrap:149)
at Module../src/components/AskLeniComponent.js (Images.js:4)
at __webpack_require__ (bootstrap:786)
at fn (bootstrap:149)