David
David

Reputation: 4475

I'm getting an error when calling exec in a Meteor app - Maximum call stack size exceeded undefined

This is the full error:

Internal exception while processing message { msg: 'method', method: 'myServerMethod', params: [], id: '4' } Maximum call stack size exceeded undefined

Meteor.methods
  myServerMethod: ->
    cmd = 'pwd'
    exec cmd, (err, stdout, stderr) ->

I could not, for the life of me, know why I'm getting that error. I also tried this on two different machines.

What things do I need to check?

Upvotes: 4

Views: 745

Answers (1)

richsilv
richsilv

Reputation: 8013

This error usually indicates that your method is trying to return something that is not EJSON-able, so if it's not on that list then that's why you're getting an error. In particular, you cannot return a cursor, you need to fetch the results and return them.

Upvotes: 6

Related Questions