tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.44k stars 767 forks source link

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

Open vishnug1995 opened 4 years ago

vishnug1995 commented 4 years ago

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

timocov commented 4 years ago

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.

TradeRabbit commented 4 years ago

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;

ShadiSimplbit commented 3 years ago

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

CryptoUncleSam commented 3 years ago

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

AKCodez commented 2 years ago

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!

timocov commented 2 years ago

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.

AKCodez commented 2 years ago

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.