arunoda / meteor-streams

Realtime messaging for Meteor
http://arunoda.github.io/meteor-streams
MIT License
287 stars 97 forks source link

emit not working - not emiting to all clients and Random is not defined. #40

Open ghost opened 8 years ago

ghost commented 8 years ago

Just in stalled Streams and added the standard example code (with correct permissions)

chatStream = new Meteor.Stream('chat');

sendChat = function(message) { chatStream.emit('message', message); console.log('me: ' + message); };

chatStream.on('message', function(message, arg) { console.log(arg); console.log('user: ' + message); });

I run into the following two errors:

  1. When I load my Meteor app for the first time I get the following exception: I20151005-11:50:11.732(1)? Exception from sub stream-chat id S6sjbJYZ3zn4wLr8f ReferenceError: Random is not defined I20151005-11:50:11.734(1)? at [object Object]._handler (packages/streams/lib/server.js:40:1) I20151005-11:50:11.734(1)? at maybeAuditArgumentChecks (livedataserver.js:1692:12) I20151005-11:50:11.734(1)? at [object Object]..extend._runHandler (livedataserver.js:1023:17) I20151005-11:50:11.734(1)? at [object Object]..extend._startSubscription (livedataserver.js:842:9) I20151005-11:50:11.734(1)? at [object Object]..extend.protocol_handlers.sub (livedata_server.js:614:12) I20151005-11:50:11.734(1)? at livedata_server.js:548:43 I20151005-11:50:13.321(1)? Exception from sub stream-chat id 7bv8NZNAp7pP9KT8G ReferenceError: Random is not defined I20151005-11:50:13.321(1)? at [object Object]._handler (packages/streams/lib/server.js:40:1) I20151005-11:50:13.321(1)? at maybeAuditArgumentChecks (livedataserver.js:1692:12) I20151005-11:50:13.321(1)? at [object Object]..extend._runHandler (livedataserver.js:1023:17) I20151005-11:50:13.321(1)? at [object Object]..extend._startSubscription (livedataserver.js:842:9) I20151005-11:50:13.321(1)? at [object Object]..extend.protocol_handlers.sub (livedata_server.js:614:12) I20151005-11:50:13.322(1)? at livedata_server.js:548:43
  2. Events are not emitted to all clients, only the sender.
team-pie commented 8 years ago

has this been fixed? I'm having a similar issue

kusmierz commented 8 years ago

Try add to your app package Random:

meteor add random
team-pie commented 8 years ago

Yeah I did that. Thanks. Would be nice to include it in the dependencies

kusmierz commented 8 years ago

@papero-co I think so too, but unfortunately it seems the project is no longer maintained :( see #21

team-pie commented 8 years ago

I've seen that. I could not tell if @lepozepo had taken over. Anyway problem fixed for me :)