Skip to main content
Participant
November 10, 2017
Answered

RangeError: Maximum call stack size exceeded Error

  • November 10, 2017
  • 4 replies
  • 22316 views

Hi,

I got this error recently where the animation won't start to due to a stack limit breached. This only occurs on Google Chrome. I have browser tested it on all major browsers such as Safari, IE, Firefox and Edge. Everything seemed fine.

Source code

function init() {

  canvas = document.getElementById("verticalSlideshow");

  anim_container = document.getElementById("vertical_container");

  dom_overlay_container = document.getElementById("vertical_overlay_container");

  images = images||{};

  ss = ss||{};

  var loader = new createjs.LoadQueue(false);

  loader.addEventListener("fileload", handleFileLoad);

  loader.addEventListener("complete", handleComplete);

 

  loader.loadManifest(lib.properties.manifest);

}

function handleFileLoad(evt) { 

  if (evt.item.type == "image") { images[evt.item.id] = evt.result; }

}

function handleComplete(evt) {

  //This function is always called, irrespective of the content. You can use the variable "stage" after it is created in token create_stage.

  var queue = evt.target;

  var ssMetadata = lib.ssMetadata;

  for(i=0; i<ssMetadata.length; i++) {

    console.log("Image Names: "+ queue.getResult(ssMetadata.name));

    ss[ssMetadata.name] = new createjs.SpriteSheet( {"images": [queue.getResult(ssMetadata.name)], "frames": ssMetadata.frames} )

  }

  exportRoot = new lib.CombinedExpanded_RainLeafAni(); //ERROR TRIGGERS HERE

From what I gather that it is a recursive function constantly being called and Google Chrome has a limited stack memory compared to other browsers.

I initially developed this in Adobe Animate 2017 version, I updated yesterday and the 2018 exported the same source files with a small tweek. No luck.

Full Error Log

rainleaf.slideshow.init.js?oxjymg:26 Uncaught RangeError: Maximum call stack size exceeded

    at handleComplete (rainleaf.slideshow.init.js?oxjymg:26)

    at a.b._dispatchEvent (createjs-2015.11.26.min.js?oxjymg:formatted:210)

    at a.b.dispatchEvent (createjs-2015.11.26.min.js?oxjymg:formatted:171)

    at a.b._sendComplete (createjs-2015.11.26.min.js?oxjymg:formatted:5389)

    at a.b._loadNext (createjs-2015.11.26.min.js?oxjymg:formatted:6159)

    at a.b._processFinishedLoad (createjs-2015.11.26.min.js?oxjymg:formatted:6263)

    at a.b._handleFileComplete (createjs-2015.11.26.min.js?oxjymg:formatted:6212)

    at createjs-2015.11.26.min.js?oxjymg:formatted:127

    at a.b._dispatchEvent (createjs-2015.11.26.min.js?oxjymg:formatted:210)

    at a.b.dispatchEvent (createjs-2015.11.26.min.js?oxjymg:formatted:171)

If anyone could help me with this that would be great.

Thanks

This topic has been closed for replies.
Correct answer albertd9194959

Same issue here, after the update to 2018, receiving the same issue.

Edit: After some trouble shooting, my problem was tween lengths.

I had two tweens that where really long, broke those up into smaller tweened layers and  issue fixed.

4 replies

Participating Frequently
November 18, 2020

Same thing happened to me, randomly. Deleting the top camera layer worked for me, it must've added itself accidentally. Before I figured that out it, it also worked to delete entire chunks from the timeline, although undo'ing all the way back in time didn't work for some reason. Now I also save a ton of versions as I go, at every checkpoint that I get something working, and I keep notes of what is happening in each version. Kind of a pain but way easier than losing hours of work, lesson learned the hard way.

Participating Frequently
August 12, 2021

I experienced this error for first time in my life. It was about making an animation "how to draw step by step a rectangle" where all 4 lines have had its layers and mask layers. All 4 lines are "animated like pen draw it". During development all previews in Chrome was w/o issue but near the end of the project the new preview doesn't show in Chrome! By checking console I saw there error message:

Maximum call stack size exceeded at handleComplete (Drawrectangle.html:53)- Source code stopped at line:

exportRoot = new lib.Drawrectangle(); Tried to change something in my animation (there is no JS code) but no score.

Then, I gave up. probably my way of animation creation seemed to Animate too complicated (9 layers, 2 mask layers, 1 additional camera)... Same error in Edge but Firefox works as charm!  Next week I'll try some better access... if no score, I'll give up finally and try another solution. 

April 13, 2020

This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript to consume lots of stack. Sometimes calling a recursive function over and over again, causes the browser to send you Maximum call stack size exceeded error message as the memory that can be allocated for your use is not unlimited. It's possible to cause infinite recursion in a fully promisified code, too. That can happen if the promises in a chain don't actually perform any asynchronous execution , in which case control never really returns to the event loop, even though the code otherwise appears to be asynchronous. That's when it's useful to wrap your recursive function call into a -

 

  • setTimeout
  • setImmediate or
  • process.nextTick

Also, you can localize the issue by setting a breakpoint on RangeError type of exception , and then adjust the code appropriately. Moreover, you can managed to find the point that was causing the error by check the error details in the Chrome dev toolbar console , this will give you the functions in the call stack, and guide you towards the recursion that's causing the error.

 

albertd9194959
albertd9194959Correct answer
Inspiring
January 10, 2018

Same issue here, after the update to 2018, receiving the same issue.

Edit: After some trouble shooting, my problem was tween lengths.

I had two tweens that where really long, broke those up into smaller tweened layers and  issue fixed.

Participant
March 16, 2018

This solution will not work for me, I want to have longer tweens for easy editing.

UDESCO
Adobe Employee
Adobe Employee
November 10, 2017

Looks like an error due to incorrect HTML Template.

Goto your Publish Settings, Advanced Tab,

Click on 'Use Default' button under Template section and then press OK.

Now when you Test your movie does it play fine?

IsmailZDAuthor
Participant
November 10, 2017

Hi Nipun,

I am already using the default settings whilst exporting.

Just a note, this bug never existed, it functioned well on my website, however now on the latest Google Chrome it never executes.

Is it possible to look further on this ?

Thanks,

Ismail

UDESCO
Adobe Employee
Adobe Employee
November 10, 2017

Can you upload your fla file somewhere and share the link to have a look at it.

Also can you confirm if your file used to publish fine from a previous version of Animate and doesn't publish correctly now?

Does it work on other browsers than Chrome?