RIAEvangelist / node-phidget-API

Node.JS Phidget API supporting all phidgets!
Other
10 stars 7 forks source link

Object.observe is not a function #59

Closed sops21 closed 7 years ago

sops21 commented 7 years ago

Running Node 6.9.1

When following the InterfaceKit Example

I'm getting the following error:

`/Users//Projects//***/node_modules/phidgetapi/lib/InterfaceKit.js:226 Object.observe( ^

TypeError: Object.observe is not a function at new InterfaceKit (/Users//Projects///node_modules/phidgetapi/lib/InterfaceKit.js:226:12) at Object. (/Users//Projects///app.js:10:8) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/Users/jasonsmall/Projects/busserver/busserver/bin/www:7:28)`

Any thoughts?

RIAEvangelist commented 7 years ago

I guess it finally got removed as deprecated in the latest node.

We'll have to update the code base for the latest node.

nexflo commented 7 years ago

Is this happening? Not working on current installs - so an update would be rad 👍

nexflo commented 7 years ago

new JS Proxy function should probably do it?

nexflo commented 7 years ago

npm install object.observe

require('object.observe');

As a quick fix for everyone. Could probably just integrate this into main package as a PR as its a polyfill and will work for old and new browsers. Not the most elegant solution as its deprecated but it makes it work. Cleaner to rewrite with Proxies. (wont work on old version then tho?)

RIAEvangelist commented 7 years ago

this could be integrated into the module as a dep if you have time. I will release if your submit PR.

nexflo commented 7 years ago

62 and #63 are in. Integrated as dependency.

I would propose to push these to npm as well - after being tested - as the current version is unusable for all node version released over a year.

Best

RIAEvangelist commented 7 years ago

fixed by #62 & #63

RIAEvangelist commented 7 years ago

published and added as contributor on phidgetapi npm module