In my Create React App when importing the lightweight-chars like so everything's working:
import { createChart } from 'lightweight-charts';
However, when running tests with:
yarn test --all
this error is shown:
● Test suite failed to run
.../node_modules/lightweight-charts/dist/lightweight-charts.esm.development.js:7
import { bindToDevicePixelRatio } from 'fancy-canvas/coordinate-space';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
...
Please suggest if looks familiar.