question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError: Maximum call stack size exceeded

See original GitHub issue

v2.4.10, node 0.6.7

Before creating this issue I searched the google group and other issues and it looks like this error has popped up before, but here is the sequence of events that cause this error for me.

  1. A Buffer field (password) with a setter to hash the password
  2. Password is set to the same/similar string

Below is some console output showing this:

> User.findOne({email:/fit/},u); // assign return to u
> u.password = 'rangeerr';
RangeError: Maximum call stack size exceeded
> u.password = 'notrangerr';
'notrangerr'
> u.save(c) 
undefined
> User.findOne({email:/fit/},u); // assign return to u
> u.password = 'rangeerr';
'rangeerr'

model code:

function hashPass(password) {
  return crypto.createHash('sha1').update(app.secret_token+String(password)).digest();
} 

var User = new Schema({
  email: {type: String, lowercase:true, trim:true, required:true, validate: [stringUtil.isValidEmail, 'Invalid email format'] },
  name: String,
  password: {type: Buffer, set: hashPass, required:true }
});

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gitfycommented, Jan 18, 2012

I get it also. This happens when you do a find and in the callback try to create another object, you see the exception.

0reactions
gitfycommented, Feb 3, 2012

Great. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >
How to fix: "RangeError: Maximum call stack size exceeded"
A "RangeError: Maximum call stack size exceeded" is an error that occurs when a function or operation tries to execute too many nested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found