我正在使用所有最新版本的create-react-app,react,webpack和amcharts。我已经使用webpack实现了一个amchart组件,并将其发布到我们本地的npm注册表中,并尝试将其导入到create-react应用中。当我使用amchart组件时,它会抛出这样的错误
webpackHotDevClient.js:45 Uncaught TypeError: Cannot read property 'dispose' of undefined
我尝试使用不同版本的amcharts 4 这些是我使用的版本
//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)