All Questions
42 questions
0
votes
0
answers
112
views
Node Js:- RangeError: Maximum call stack size exceeded
I am building a Node Js application using Passport & Passport-SAML Packages for incorporating SAML Login. I have a front-end React app that need to be served after the user successfully ...
1
vote
1
answer
78
views
why setImmediate function executes after setTimeout
setImmediate(() => {
console.log("set immediate function calling")
})
setTimeout(() => {
console.log("setTime out function")
}, 1000)
for (let i = 0; i <= ...
0
votes
1
answer
1k
views
LibUV NodeJS handle synchronous or asynchronous tasks?
I'm Nodejs beginner. I have been reading some documents and posts on Google and as far as I know, LibUV is used to handle asynchronous tasks. However, when I came across a post recently, the author ...
0
votes
1
answer
36
views
JavaScript - result undefined - forcing one method to complete before another?
I have the following NodeJS code running in an AWS Lambda:
const https = require('https');
exports.handler = async event => {
try {
const currentWeekNumber = getWeekNumber(new Date(Date....
0
votes
1
answer
68
views
How to get call stack in VSC debugger? console.trace() is undefined
If I'm paused in the VSC debugger I can't get the call stack with console.trace().
0
votes
2
answers
205
views
Where will this callback function be registered in Node.js and how does it behave?
const add = (n1, n2, callback) => {
setTimeout(() => {
const sum = n1 + n2
callback(sum)
},2000)}
add(1, 4, (sum) => {
console.log(sum) // Should print: 5
})
I ...
0
votes
1
answer
190
views
Managing sync and async functions in an algorithm call stack
TLDR: must I use async and await through a complicated call stack if most functions are not actually async? Are there alternative programming patterns?
Context
This question is probably more about ...
1
vote
0
answers
155
views
Node.js stack-size silently crashing
I have a JavaScript commandline program that needs more stack space. The option for this is node --stack-size but it's not working for me. Test case:
'use strict'
function f(...a) {
console.log(a[...
0
votes
1
answer
69
views
What are things to avoid in order to get the full async error callstack on Node.js?
Is it an anti-pattern to use async/await inside of a new Promise() constructor?
I had read this question and answers, but not sure why am I still getting part of the error only and I am sure there are ...
0
votes
1
answer
153
views
will the setImmediate or the IO callback run first?
in this diagram is says that the event Loop will run the I/O callbacks (the axios request), then the check phase (setImmediate), but when i tested this, it was the opposite, i need explanation of the ...
1
vote
2
answers
481
views
will the micro-task queue or the macro-task queue run first?
i was reading an article about Promises and the event queue, and from what I understood, the event loop has a "micro-task queue" and a "macro-task queue".
and from that article is ...
11
votes
2
answers
6k
views
Async Stack Traces in Node.js 14.15.0
Based on the documentation I would assume that Node.js 14 does now support stack traces in async code but unfortunately using node --async-stack-traces test.js still generates only a partial stack ...
0
votes
1
answer
70
views
RangeError: Maximum call stack size exceeded while using graphicsmagick (npm gm) in SailsJS
I'm facing a weird issue when I try to convert a TIFF file to JPG in the server using graphicsmagick (npm gm). When I try to use any method of gm package, I am getting the RangeError: Maximum call ...
9
votes
1
answer
418
views
How to estimate javascript call stack maximum size?
I have 2 node js programs.
console.log('TEST A:');
function computeMaxCallStackSizeA() {
try {
return 1 + computeMaxCallStackSizeA();
} catch (e) {
return 1;
}
}
for (...
0
votes
1
answer
2k
views
Limiting Recursion Depth in NodeJS
Is there a way to limit the depth of recursion in NodeJS other than the --stack-size option?
I know that NodeJS will let you control the size of you call stack via the --stack-size option. i.e. a ...
3
votes
0
answers
83
views
NodeJS and CallStack Size Protection [duplicate]
Does NodeJS offer the ability to view or set any limits (at run time or via CLI flags?) for the size of the call stack?
If I create a program that looks like this an run it
const recurse = (num=0) =&...
0
votes
1
answer
371
views
Reduce call stacks size in Javascript
When I know that particular call is last in a function and I have to return nothing from the function, Can I reduce call stack size?
Here is the example
constructor(){
this.processNext = this.a;
...
1
vote
0
answers
1k
views
What does the callstack look like with promises and async/await?
I recently watched this video: https://www.youtube.com/watch?v=8aGhZQkoFbQ and am trying to find a similar explanation for with Promises. Specifically in node.
I'm probably wrong but I'm under the ...
1
vote
1
answer
93
views
Maximum calls does not exceed on certain code inside function in NodeJS
My question is rather simple. I just don't understand this behavior that is happening in my NodeJS environment.
The code below does not exceed maximum function call stack:
const loop = (i, maxI) =&...
2
votes
0
answers
261
views
Are stack frames stored in the call stack in Node.js?
Are stack frames (added for each function call; hold local variables) actually stored with the call stack or elsewhere? This would make sense because of the LiFo nature of stacks.
11
votes
1
answer
8k
views
Does Go have an "infinite call stack" equivalent?
I'm a newbie to Go, coming from Node.JS.
In Node, if I run this:
function run(tick = 0) {
if (tick < 1000000) {
return run(tick + 1);
}
return 0;
}
console.log(run());
The program ...
0
votes
1
answer
656
views
node.js call stack exceeded with sockets.io
I am doing a project where I have to continuesly poll the status of a number of devices on the network (local network) and then emit the status of this to the clients on a socket.io connection.
I can ...
2
votes
1
answer
8k
views
Recursive new Promise: RangeError: Maximum call stack size exceeded
I'm getting a RangeError: Maximum call stack size exceeded
function getUser(userId) {
return new Promise((resolve, reject) => {
controller.storage.users.get(userId, function(err, user) {
...
4
votes
1
answer
2k
views
Get deobfuscated typescript callstack from obfuscated javascript code
Problem:
I have log files from a server, which contain the callstacks from the thrown error, that triggered the creation of this log file. The server application is written in typescript with nodejs ...
2
votes
0
answers
100
views
Try to understand more about Javascript -Node.js Async call stack
If I have the following code:
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/:name', function(req, res, next) {
let name = req.params.name;
...
0
votes
1
answer
98
views
latin-square.js Maximum call stack size exceeded
I am trying to use latin-square library for node.js in a loop to find some pattern, run the script and after 2 minutes have this error:
RangeError: Maximum call stack size exceeded
var latinSquare ...
1
vote
1
answer
953
views
Inspect live objects/stack in node.js
In node.js, is there something similar to inspect.stack() and inspect.currentFrame() from Python?
Like, capturing code context/frames/inspecting live object.
2
votes
1
answer
2k
views
RangeError: Maximum call stack size exceeded for Node.js
I created model script in JS, so I can pass in an object and add in some logic and values. I use get/set to produce the values, however when i run my code it throws an RangeError: Maximum call stack ...
0
votes
1
answer
407
views
Does a new node.js process created by fork (new process) or spawn (child process) get it's own separate call stack?
When creating a new node.js process programmatically by forking a process or spawning a new child process; does the new process or child process get it's own separate call stack?
1
vote
3
answers
64
views
Async / Callstack confusion
Alrighty, I'm pretty sure I know what the issue is, but I can't for the life of me figure out how to resolve it.
The way the below code works is the front-end sends two words back to the server, ...
5
votes
1
answer
1k
views
node streams - get maximum call stack exceeded
I cant seem to figure out why I'm getting this error with my stream pipeline. I think I have exhausted all paths, so is there something Im missing: Here is what I have:
var myCsvStream = fs....
0
votes
0
answers
137
views
I am getting "Maximum call stack size exceeded" in MongooseJS
I am trying to update an object in mongoose:
Category.findByIdAndUpdate(product.category, {
$addToSet: {
products: product
}
}, function(err) {
if (!err) {
req....
0
votes
1
answer
834
views
Maximum call stack size exceeded even with only 1 iteration
My while loop is giving me an error of call stack size exceeded, so I tried to limit it in some ways that did not work and now, I have the following piece:
var hasnext = true;
while(hasnext) {
...
0
votes
1
answer
2k
views
NodeJS POST keeps pending
I am posting a json string with jQuery to my NodeJS backend, and having issues with handeling post data in my backend. It looks like the backend is blocking somewhere, but I can't find where. ...
0
votes
1
answer
2k
views
Profiling JavaScript Code on nodejs - Possible Approaches
My aim is to develop a java script profiler for nodejs .
The requirements are as under :
Should be able to fetch call stack .
Get Time stamp information.
Get number of iterations.
My chief concern ...
0
votes
0
answers
394
views
Avoiding exceeding call stack size in Node.JS with Mongoose
I'm relatively new to Node, so please do point any and all errors you see out.
I'm trying to write a relatively simple application; take JSON string of ~1k objects, split them up into groups and ...
107
votes
12
answers
242k
views
Node.js - Maximum call stack size exceeded
When I run my code, Node.js throws a "RangeError: Maximum call stack size exceeded" exception caused by too many recursive calls. I tried to increase Node.js stack size by sudo node --stack-size=16000 ...
30
votes
1
answer
25k
views
What is the default stack size in Node.js?
I know how to set the stack size thanks to:
How can I increase the maximum call stack size in Node.js
But, what is the default size? (ie how do I get to the PHP equivalent of phpinfo())
0
votes
1
answer
299
views
Callstack exceeded without even any recursion.. what's going on?
Anyone've any idea why this might be incurring a call stack? I'm not even recursing.
The error:
C:\Documents and Settings\j\Desktop\bmrepl\STEAL\dedup.js:7
this.push.apply(this, rest);
...
1
vote
0
answers
123
views
Processing a 40MB+ object in JS
I have a bit of an unusual situation involving some 179586 bookmarks in chrome. Most of these are duplicates, and I need to remove those.
Obviously, this process would need to be automated with a ...
4
votes
2
answers
879
views
Can a lot of data exceed stack size in Node.js?
I am not very familiar with the inner workings of Node.js, but as far as I know, you get 'Maximum call stack size exceeded' errors when you make too many function calls.
I'm making a spider that ...
67
votes
2
answers
69k
views
How can I increase the maximum call stack size in Node.js
This is different to other questions regarding an error message in Node that reads RangeError: Maximum call stack size exceeded in that I know exactly why I'm getting this error message. It's ...