svg-gauge icon indicating copy to clipboard operation
svg-gauge copied to clipboard

Gauge is not defined

Open patson12 opened this issue 3 years ago • 4 comments

i am getting error while working with electron js..

index.js:224 Uncaught ReferenceError: Gauge is not defined

patson12 avatar May 27 '22 09:05 patson12

Hi @patson12 can you share a repo or some starter code?

naikus avatar Jun 02 '22 10:06 naikus

@naikus I'm guessing it is because svg-gauge is not a module therefore there's no default exporter. I wish the codebase could be converted to ES6+ so modifications could be easier. I'm still learning JS, so I couldn't really digest the codebase to make it ES6 for easier IDE integration.

Is it possible to make it ES6+ with TS support? If so then I'm willing to make TS declaration interface for svg-gauge :)

moalamri avatar Jun 27 '22 22:06 moalamri

@moalamri svg-gauge is an es module and I've used it in my project via require("svg-gauge") and import gauge from "svg-gauge"

naikus avatar Jul 03 '22 08:07 naikus

I'm sorry I didn't notice the ts declaration interface svg-gauge.d.ts

It's because I wanted to change few things, but I didn't clone the whole package (only src/index.js) that's why I was getting not a module error.

Anyways I wish if the source is more human readable 😅 maybe it's only difficult for me. Since you have better experience in JS, is there a way to have one-click solution to convert between JS versions?

Thanks

moalamri avatar Jul 03 '22 13:07 moalamri