RangeError: Maximum call stack size exceeded
See original GitHub issuev2.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.
- A Buffer field (password) with a setter to hash the password
- 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:
- Created 12 years ago
- Comments:9 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I get it also. This happens when you do a find and in the callback try to create another object, you see the exception.
Great. Thanks.