Per the tsconfig docs, when using this option, the tslib module must be available to be imported at runtime. However, this library does not include tslib as a dependency, and instead relies that tslib will be available from another dependency at the top of the node_modules folder. The echarts peer dependency does include tslib as its own dependency, but depending on how the package manager decides to hoist, it may or may not be available, and so can lead to this module unexpectedly not working. This is happening to me in a monorepo and so we are using a fork of this library that adds tslib, an alternative would be that we need to install tslib in our package.json file.
Making an issue for this seeing as how #494 was closed without comment.
This library enables the
importHelpers
option in the tsconfig.json:https://github.com/hustcc/echarts-for-react/blob/a35220e42c18b5f1714e31f61a8ba0f7f2f27334/tsconfig.json#L10
Per the tsconfig docs, when using this option, the
tslib
module must be available to be imported at runtime. However, this library does not include tslib as a dependency, and instead relies that tslib will be available from another dependency at the top of thenode_modules
folder. Theecharts
peer dependency does includetslib
as its own dependency, but depending on how the package manager decides to hoist, it may or may not be available, and so can lead to this module unexpectedly not working. This is happening to me in a monorepo and so we are using a fork of this library that adds tslib, an alternative would be that we need to installtslib
in ourpackage.json
file.This is similar to an issue
echarts
itself ran into last year: https://github.com/apache/echarts/pull/13573