charting-library-examples icon indicating copy to clipboard operation
charting-library-examples copied to clipboard

"export 'widget' was not found in '../charting_library.min' when building

Open vishnug1995 opened this issue 4 years ago • 7 comments

when building electron vuejs it shows "export 'widget' was not found in '../charting_library.min' when building" , but work fine in development.

vishnug1995 avatar Apr 06 '20 11:04 vishnug1995

Did you looking for similar issues like https://github.com/tradingview/charting-library-examples/issues/80#issuecomment-483326985 or something? charting_library.min.js is UMD module, which has export widget.

timocov avatar Apr 07 '20 09:04 timocov

I have been encountering the same error, the only solution so far is to put it in a new, clean project, when it is integrated with an existing project this error happens, I have not yet been able to identify where the incompatibility is;

TradeRabbit avatar Jul 30 '20 21:07 TradeRabbit

import { widget } from '../vendor/charting_library/charting_library.esm'; this works for me

ShadiSimplbit avatar Dec 15 '20 12:12 ShadiSimplbit

Following ShadiSimplbit I did the follow! Copy charting_library folder into public and src src --> component --> TVChartContainer open index.jsx Change ../charting_library.min to the full path of ../charting_library/charting_library.esm.js

CryptoUncleSam avatar Dec 15 '20 14:12 CryptoUncleSam

Mine broke as well when updating to V20, i had .../path/to/charting_library/charting_library.cjs and changed it to .../path/to/charting_library/charting_library.esm.js and it began working!

AKCodez avatar Jan 07 '22 20:01 AKCodez

usually you don't need to use the full path to a file since charting library has a package.json file where we have a main and module fields declared so they should be handled by your bundler correctly.

timocov avatar Jan 11 '22 17:01 timocov

Yes, but the file has ES-Lint errors, which are so severe that it will not let the bundle compile without specifying es-lint disable in the file.

AKCodez avatar Jan 11 '22 17:01 AKCodez