RobotWebTools / roslibjs

The Standard ROS JavaScript Library
https://robotwebtools.github.io/roslibjs
Other
691 stars 382 forks source link

maxEventListeners is not a function #217

Closed spaghetti- closed 7 years ago

spaghetti- commented 8 years ago

I'm using the latest release with node (tested with 4.0 and 5.4) and I'm getting the following error:

Uncaught TypeError: this.setMaxListeners is not a function

Is there anything I'm missing? Even if I remove this line, this.connect() seems to fail indicating that something else is not loading/exporting as expected.

peterpolidoro commented 8 years ago

I get the same error:

main.bundle.js (line 36574) ORIGINAL EXCEPTION: this.setMaxListeners is not a function

I am trying to use roslibjs with node v6.9.1 and TypeScript.

T045T commented 8 years ago

Looks like you might be missing the new keyword:

$ node
> var roslib = require('roslib');
> var foo = roslib.Ros();
TypeError: this.setMaxListeners is not a function
[...]
> var asdf = new roslib.Ros();
undefined
> asdf
RosTCP {
  encoding: 'utf8',
  socket: null,
  idCounter: 0,
  isConnected: false,
  groovyCompatibility: true,
  _events: { maxListeners: 0 },
  _conf: { maxListeners: 0 } } 
peterpolidoro commented 8 years ago

That works for me, thanks!!

vkuehn commented 7 years ago

so that issue can be closed right ?

T045T commented 7 years ago

Looks like it :)