Sails.sockets.broadcast RangeError: Maximum Call Stack Size Exceeded

I have this code:

module.exports = {
    test: function(req, res) {
        Model.create({...}).exec(function (err, created) {
            if(err) { ... }

            sails.sockets.broadcast('abc', 'abc', created);

            return res.json({ ... });
        });
    }
};

And I get RangeError: Maximum call stack size exceededthrown in/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:82

When I delete a line sails.sockets.broadcast(...), it does not crash.

It was not clear to me how I could find which line caused the error. Even with the team node-debug.

Is this a bug in sails.js? How can I fix this problem?

+4
source share
1 answer

Can I see the client code that listens for the "abc" event? Perhaps you are creating an endless loop.

0
source

All Articles