Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

GruntJS and Maximum Call Stack Size Exceeded Warning

DZone's Guide to

GruntJS and Maximum Call Stack Size Exceeded Warning

· Web Dev Zone
Free Resource

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

I am trying to set up a GruntJS build pipeline for one my side projects and ran into a very interesting warning today, shown below.

image 

What was weird was that this warning or error only started when I added my task to compile my Typescript code.  If I called the default task, which did not compile the Typescript code, everything worked as expected.  Of course, because the Typescript task was failing, I assumed the error had something to do with its configuration.  However, as you can see, my Typescript setup is pretty simple:

image

Because my setup looked right I thought it would be a smart idea to run the task with the verbose output via the grunt typescript –v command.  The second I ran this I saw the issue …

image

The Running “typescript” task goes on and on until we hit our stack overflow.

I immediately changed focus from my Typescript configuration to my task configuration and saw the issue.

image

Looking at my task setup above I saw the issue.  It is a bad idea to name your Grunt task the same as one of the target tasks in your config … D'OH.

After changing the name of my Grunt tasks as follows, the world was a happy place.

image

The moral of the story is two-fold:

  1. Do NOT name your Grunt task the same as your configuration element.
  2. Use the –v option to see what is really going on when a Grunt task fails.

Until next time.

P.S. If you want to learn more about Knockout, watch my Pluralsight Course on KnockoutJS.

P.P.S. If you want to learn how to transition your XAML skills to HTML, you can watch my course on HTML for the XAML Developer

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.

Topics:

Published at DZone with permission of Derik Whittaker, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}