Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tapansharma opened this issue Jun 22, 2023 · 3 comments

Comments

@tapansharma
Copy link

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
Copy link
Contributor

edew commented Jun 22, 2023

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.

@edew edew closed this as completed Jun 22, 2023
@tapansharma
Copy link
Author

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
Copy link

@tapansharma everything is already minified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants