chartist
chartist copied to clipboard
Using chartist with Electron, Chartist not defined?
I'm having an issue where running a very simple example chart is failing to load, giving the error Uncaught ReferenceError: Chartist is not defined
in the error console. (I also tried this known-good example with the same results.)
Electron is node based, but using a full chromium browser as the UI, so all the required DOM elements described here should be present and functional. Is there anything I can do to fix this issue, or will it be officially fixed soon?
Disabling node integration within electron works as a workaround, but limits the features of the app in other unacceptable ways for many applications.
I found the solution, I needed to do <script> Chartist=require('path/to/chartist.js') //rest of js here </script>
instead of <script src='path/to/chartist.js'>
. Is this a known behavior? It would probably help if this was documented somewhere, if it isn't already
Hello @Patronics 👋
Chartist has recently been updated to version 1.0
with some new exciting changes like ESM and TypeScript support. The migration guide can be found right here.
Please let me know if the issue is still relevant to you so we can further investigate it!