Skip to content
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

RangeError: Maximum call stack size exceeded #66

Closed
ghost opened this issue Nov 6, 2011 · 7 comments
Closed

RangeError: Maximum call stack size exceeded #66

ghost opened this issue Nov 6, 2011 · 7 comments

Comments

@ghost
Copy link

ghost commented Nov 6, 2011

I have this error when I use mapSeries with a large array :
RangeError: Maximum call stack size exceeded

@caolan
Copy link
Owner

caolan commented Nov 8, 2011

Sounds like you're probably using a synchronous function. With an async function, this won't happen.

@caolan caolan closed this as completed Nov 8, 2011
@ghost
Copy link
Author

ghost commented Nov 8, 2011

I need the synchronous version...

@caolan
Copy link
Owner

caolan commented Nov 8, 2011

That would be Array.prototype.map in modern browsers. You might want to look at underscore.js if you need support for older versions.

@ghost
Copy link
Author

ghost commented Nov 8, 2011

First I am coding in server side (Node).
Second I need mapSeries (each iterator in series!)
The problem appear only with large array (over ~3500 items)...

@ghost
Copy link
Author

ghost commented Nov 8, 2011

For example :
async.mapSeries(
arr,
function (item, callback) {
// Action taking server ressource and a bit of time...
// Then when finish call the callback for next item...
},
function (err, results) {
// ...
}
});

If my collection have less than 3000 items everything work fine but over a certain limit (~3500) not anymore...

@bobrik
Copy link

bobrik commented Nov 8, 2011

try process.nextTick(callback), but usual Array.prototype.map should be enough for synchronous map in nodejs

@giacecco
Copy link

Same problem here, I am not using sync functions in mapSeries, and bobrik's suggestion does not solve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants