-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ReferenceError: Dygraph is not defined #1009
Comments
it seems similar to #848 |
mirabilos
added a commit
that referenced
this issue
Feb 9, 2023
• taken initially from the existing one that require()s from smooth-plotter and synchroniser, for obtaining the Dygraph “global” in a module system • some ways to import put it as .default though so use that if .NAME is absent but .default is defined • apply this to all extras, fixing (#848) (#989) (#1009) • drop redundant closure where applicable, suitably label otherwise • label all functions here
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I am using react and I want to use the hairlines plugins of the dygraph. But whenever I am trying to use that plugin after compilation in the browser error comes dygraph is not defined. It comes from the hairline.js in the dygraph node module.
I import this two files as shown in the example but than also the error comes.
import Dygraph from 'dygraphs/dist/dygraph'
import Hairlines from 'dygraphs/src/extras/hairlines'
I tried
import Dygraphs from 'dygraphs/index.es5';
import Hairlines from 'dygraphs/src/extras/hairlines'
but same error was coming
To make it work I am editing the hairline.js and adding the import Dygraph from '../../index.es5' line and after that it is working perfectly fine. But as this is a node module and everyone will install on their laptops all of them need to edit it.
Am I missing some other imports or is there any other way we can use the hairlines plugin.
The text was updated successfully, but these errors were encountered: