Skip to content Skip to sidebar Skip to footer

"Exited With Code 8" Sample Meteor Applications

I am new to Meteor.js and currently working on the 'leaderboard' example app. After inserting a line of code: Template.leaderboard.player = function(){ return 'Some other text' }

Solution 1:

Make sure that you added the Template helper code inside if(Meteor.isClient){} block. If you added the coded in a common area it will try to run the code in the server side also and obviously Template is not available in server side.

if (Meteor.isClient) {
  Template.leaderboard.helpers({
    players: function () {
      return "Some other text"
  }
});

Solution 2:

In my case the error code was same i.e. 8 but the stack trace was different. This was my stack trace.

W20150821-20:23:59.161(5.5)? (STDERR) Error: A method named '/players/insert' is already defined
W20150821-20:23:59.161(5.5)? (STDERR)     at packages/ddp/livedata_server.js:1461:1
W20150821-20:23:59.161(5.5)? (STDERR)     at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20150821-20:23:59.161(5.5)? (STDERR)     at [object Object]._.extend.methods (packages/ddp/livedata_server.js:1459:1)
W20150821-20:23:59.161(5.5)? (STDERR)     at [object Object].Mongo.Collection._defineMutationMethods (packages/mongo/collection.js:904:1)
W20150821-20:23:59.161(5.5)? (STDERR)     at new Mongo.Collection (packages/mongo/collection.js:209:1)
W20150821-20:23:59.162(5.5)? (STDERR)     at app/leadboard.js:45:15

I was working on something. And then I did take the backup of my files and kept it in same folder. Due to which the statement like below

CollectionName = new Mongo.Collection('collection-name')

was appearing twice in the whole project. That is why I was getting this error. I removed my backup files and things got sorted out. Hope it helps someone in future.


Solution 3:

I similarly received the same error!

I had the line of code

PlayersList = new Mongo.Collection('players');

in both my client document and server document.

It looks like this error happens due to repetition or not having collection declarations in the right place.


Post a Comment for ""Exited With Code 8" Sample Meteor Applications"