leapjs icon indicating copy to clipboard operation
leapjs copied to clipboard

Importing LeapJS result in an error

Open tsepton opened this issue 3 years ago • 0 comments

With the Orion software installed (4.1.0+52211) and LeapJS installed through npm (1.1.1), the following line import * as Leap from "leapjs"; resulted in the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at node_modules/leapjs/lib/controller.js (controller.js:717:50)
    at __require (chunk-OL3AADLO.js?v=ce322448:9:50)
    at node_modules/leapjs/lib/index.js (index.js:6:15)
    at __require (chunk-OL3AADLO.js?v=ce322448:9:50)
    at dep:leapjs:1:16

Seems like EventEmitter is undefined inside the controller.js file:

Object.assign(Controller.prototype, EventEmitter.prototype);

PS: The "Allow Web Apps" ticking option is checked within the Leap Motion Control Panel.

tsepton avatar Nov 29 '22 10:11 tsepton