I'm running into the following error in my GruntJS script:
Maximum call stack size exceeded"
What's the proper syntax for invoking the node flag --max-stack-size= in my grunt command so I can set aside a larger amount of memory for the stack?
Unless you are doing some very high-level programming in GruntJS I think you may have a cyclic task registered.
If you name a task the same name as plugin it will run an infinite amount of times:
grunt.registerTask('uglify', ['uglify'])
This results in the task calling itself.
In order to verify what you're doing, run the grunt with --verbose (or --v) command to see what grunt is running.
For instance run grunt uglify --v and notice how many times it runs. This can be fixed easily by changing the task name to something else.
If however you're sure of what you're doing run grunt with --max-stack-size=10000
or whatever...
Install grunt-cli locally with npm install grunt-cli then call it locally with:
node --max-stack-size=val ./node_modules/.bin/grunt
Although likely you're getting that error because of an infinite recursion that should be fixed.
Similar issue happend to me when I dynamicaly called tasks via grunt.task.run().
Seems that grunt's success callbacks filled tha NodeJs stack.
I performed manual edit of c:\Users\%UserName%\AppData\Roaming\npm\grunt.cmd (on Windows). Add parameter supported by your version of node, e.g --stack_size=2000 (for details use node -help).