-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In what cases would give out the [Maximum call stack size exceeded] error? #399
Comments
me too RangeError: Maximum call stack size exceeded |
me too /node_modules/engine.io/lib/socket.js:338 |
It seems that if you do not allow the main thread to take a break and process the queued up IO, then you will receive this error as the queues will overflow. If you break out of your current op, by calling setTimeout() or some other means to yield execution momentarily, the buffers will be cleared. |
[].push.apply([], new Array(200000));
// throws 'RangeError: Maximum call stack size exceeded' If it is actually the reason, it can be fixed with a for loop: this.sentCallbackFn.push.apply(this.sentCallbackFn, this.packetsFn);
// becomes
for (var i = 0; i < this.packetsFn.length; i++) {
this.sentCallbackFn.push(this.packetsFn[i]);
}; Related: socketio/socket.io#2589 |
Before that commit, undefined callbacks were also added to the array, which could lead to 'Maximum call stack size exceeded' error when flush() method was called. Fixes socketio#399
Before that commit, undefined callbacks were also added to the array, which could lead to 'Maximum call stack size exceeded' error when flush() method was called. Fixes #399
RangeError: Maximum call stack size exceeded
at Socket.flush (/Users/xidui/Documents/xidui/github/NodeBB/node_modules/engine.io/lib/socket.js:413:32)
at emitNone (events.js:85:20)
at WebSocket.emit (events.js:179:7)
at Array. (/Users/xidui/Documents/xidui/github/NodeBB/node_modules/engine.io/lib/transports/websocket.js:109:14)
at _stream_writable.js:383:15
at afterWrite (_stream_writable.js:346:3)
at onwrite (_stream_writable.js:337:7)
at Socket.WritableState.onwrite (_stream_writable.js:89:5)
at WriteWrap.afterWrite (net.js:775:12)
RangeError: Maximum call stack size exceeded
at Socket.flush (/Users/xidui/Documents/xidui/github/NodeBB/node_modules/engine.io/lib/socket.js:413:32)
at emitNone (events.js:85:20)
at WebSocket.emit (events.js:179:7)
at Array. (/Users/xidui/Documents/xidui/github/NodeBB/node_modules/engine.io/lib/transports/websocket.js:109:14)
at _stream_writable.js:383:15
at afterWrite (_stream_writable.js:346:3)
at onwrite (_stream_writable.js:337:7)
at Socket.WritableState.onwrite (_stream_writable.js:89:5)
at WriteWrap.afterWrite (net.js:775:12)
The text was updated successfully, but these errors were encountered: