nurdism / neko

A self hosted virtual browser (rabb.it clone) that runs in docker.
Apache License 2.0
2.03k stars 185 forks source link

Build is broken due to type checking error #78

Closed barzamin closed 4 years ago

barzamin commented 4 years ago

Describe the bug

Building Neko fails with the error

ERROR in /workspace/client/src/components/video.vue(414,7):
414:7 No overload matches this call.
  Overload 1 of 2, '(event: "wheel" | "mousemove", data: { x: number; y: number; }): void', gave the following error.
    Argument of type '"keyup"' is not assignable to parameter of type '"wheel" | "mousemove"'.
  Overload 2 of 2, '(event: "mousedown" | "mouseup" | "keydown" | "keyup", data: { key: number; }): void', gave the following error.
    Type 'string' is not assignable to type 'number'.
    412 |       let keys = Object.keys(this.activeKeys)
    413 |       for(let key of keys) {
  > 414 |         this.$client.sendData('keyup', { key })
        |       ^
    415 |         delete this.activeKeys[key]
    416 |       }
    417 |     }

Cause

Object.keys(x) will always return a string[]; however, keys needs to be stored as numbers for the sendData() call to typecheck.