tradingview / charting-library-examples

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

"this._innerWindow(...).widgetReady is not a function" when charting_library is not present in public folder #347

Closed tapansharma closed 1 year ago

tapansharma commented 1 year ago

Describe the bug

I am currently integrating charting library with my react-typescript app. My code works as planned but only when I keep charting_library in public and src folder both. I do not want the code in the public folder since it is affecting web vitals and app performance is degrading because of this.

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo charting_library/react-typescript
  2. Add charting library in src and public
  3. Add datafeed in public
  4. Everything works
  5. Now remove charting_library from public
  6. Update library_path in widget options to src/charting_library
  7. See error this._innerWindow(...).widgetReady is not a function

Expected behavior

It should be able to work

edew commented 1 year ago

The static charting_library files (HTML, CSS, JS) need to be hosted and available at the path defined by library_path so they can fetched when the library widget is created.

tapansharma commented 1 year ago

Hi @edew , There should be a way which allows us to keep library_path inside src as it is a 12.5 MB folder which will not be minimized. If I keep that folder in src and change library_path to the new location, ideally it should work

simon-v-swyftx commented 1 year ago

@tapansharma everything is already minified?