chartist icon indicating copy to clipboard operation
chartist copied to clipboard

Using chartist with Electron, Chartist not defined?

Open Patronics opened this issue 3 years ago • 2 comments

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.

Patronics avatar Aug 02 '20 01:08 Patronics

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

Patronics avatar Aug 02 '20 02:08 Patronics

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!

Arantiryo avatar Nov 21 '22 12:11 Arantiryo