In my logs I have this:
W20200408-23:28:01.485(-5)? (STDERR) RangeError: Maximum call stack size exceeded
W20200408-23:28:01.485(-5)? (STDERR) at Object.EJSON.clone (packages/ejson/ejson.js:551:15)
W20200408-23:28:01.486(-5)? (STDERR) at packages/ejson/ejson.js:600:22
W20200408-23:28:01.486(-5)? (STDERR) at Array.forEach (<anonymous>)
W20200408-23:28:01.486(-5)? (STDERR) at Object.EJSON.clone (packages/ejson/ejson.js:599:13)
W20200408-23:28:01.486(-5)? (STDERR) at packages/ejson/ejson.js:600:22
W20200408-23:28:01.486(-5)? (STDERR) at Array.forEach (<anonymous>)
W20200408-23:28:01.486(-5)? (STDERR) at Object.EJSON.clone (packages/ejson/ejson.js:599:13)
W20200408-23:28:01.486(-5)? (STDERR) at packages/ejson/ejson.js:600:22
W20200408-23:28:01.486(-5)? (STDERR) at Array.forEach (<anonymous>)
W20200408-23:28:01.486(-5)? (STDERR) at Object.EJSON.clone (packages/ejson/ejson.js:599:13)
this occurs in a deep callback structure .
Essentially, I have defined connecthandlers in WebApp, the handler receives a file from an upload, and I write it to a temp file. Then , I read the file, and write it into a Meteor-files collections, then I attempt to call a Meteor function with the file document, so that I can upload it to our video hosting service:
if(fileRef.isVideo) {
Meteor.call('video.uploadToSprout', fileRef, Attachments, (error, result) => {
if (error) {
console.error(error);
} else {
console.log('upload returned.');
}
});
}
(‘Attachments’ is a Collection)
Then, I return the fileRef to the client (as requied by my dropzone component)
When I send the Attachment Collection, I get the error above. When I leave it out, it works fine.
I have been able to send Collections as Meteor.call arguments before, so I guess it is something particular to the particular chain of callbacks and bound environments I have here.
Any ideas?