liftoff / HumanInput

A JavaScript library for handling keyboard shortcuts and other human-generated events
Apache License 2.0
583 stars 25 forks source link

__VERSION__ global not defined #18

Open DavidVollmers opened 6 years ago

DavidVollmers commented 6 years ago

Hello there,

I am using your library inside a TypeScript project.

When importing and using the HumanInput class like the following...

import HumanInput from 'humaninput/src/humaninput-full.js'

...

new HumanInput(window)

...this error is thrown: Uncaught ReferenceError: __VERSION__ is not defined

The problem is that there is global __VERSION__ required at: https://github.com/liftoff/HumanInput/blob/b96967b41afb4c7293848be19a4061024132bdbc/src/humaninput.js#L99

A hacky hotfix for me was to set the global after the import like this:

import HumanInput from 'humaninput/src/humaninput-full.js'

eval( 'window.__VERSION__ = 0' )

...

new HumanInput(window)
br4nnigan commented 5 years ago

is this project abandoned?

DavidVollmers commented 5 years ago

It is...