cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Getting a "maximum call stack size exceeded" and blank galleries on iOS devices

I am getting a "maximum call stack size exceeded" error on my app when using an iOS device and the Powerapps app that causes galleries to go blank. It doesn't happen on desktop. 

 

The app is fairly simple. It shows 2 galleries. The first gallery displays about 40-50 items, the second gallery displays 1-3 items. The galleries are tied to a collection that is formed from combining 4 collections using a lookup field. Each individual collection has about 500 records in it. The app refreshes the data every 90 seconds and recollects the combined collection, and when it does, the first gallery with ~50 items goes blank and the error message shows. The second gallery usually doesn't have a problem. Changing the refresh duration doesn't seem to make a difference. The app starts up just fine, the problem only occurs when refreshing.

 

Session ID: cf5dbea8-91d8-43e1-a53f-aca70a567769

 

Please help!!

5 REPLIES 5
Community Support
Community Support

Hi @AB48 ,

How do you refresh data within your app? Could you please share a bit more about the formula you used?

Do you mean that this issue occurs within your iOS device rather than Desktop?

 

Based on the error message that you mentioned, I think this issue may be related to the available RAM in your iOS device.

Please make sure you have enough RAM in your iOS device to run your PowerApps app. You could consider close other applications in your device, just run the PowerApps Mobile App, check if the issue is solved.

 

The user @NikoClau has faced same issue with you, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/PowerApps-with-SQL-data-Error-Maximum-call-st...

 

On your side, please also consider set the "Data row limits for Non-delegable queries" option to maximum value -- 2000, then re-publish your app, try your app in your iOS device again, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Resolver I
Resolver I

 

Having the same issue. App works great on my droid and PC. Been working with Microsoft Tech support for about 2 weeks. No resolution yet. They said it was not a known issue and they can't replicate it, but looks like it is not entirely isolated to me. 

 

I was not having an issue with any device when I was using Excel as a data source. Only became an issue when I moved my data source to CDS. I have created a new app and cut-and-pasted all the elements over. The pages will now load completely, but the "ants" never stop on the page that throws the error"maximum call stack..."

 

Worth noting my largest entity is less than 100 records.

 

Anyway, not sure any of this information will help you isolate anything on your end. I will try to remember to come back here with a solution if/when it is found.

Ultimately we did 2 things to workaround the issue.

 

First was adding some filters when ClearCollecting the CDS entities to trim down the amount of rows being brought in. This cut down on the amount of times the error was popping up, but it was still happening. 

 

The second thing we did that solved the problem completely was stopped using the native iOS Powerapps launcher. We instead use the app through Safari with the &hidenavbar=true URL parameter trick for a more native experience. Not ideal because we lost the camera functionality on the device, but at least the app is usable.

 

Also worth mentioning is that the native iOS Powerapps launcher was eating up massive amounts of storage on the device. Like +20gbs worth. Clearing the cache in Powerapps didn't do anything, only uninstalling and reinstalling helped. It seems like refreshing/clearcollecting wasn't removing old data and it was piling up on the device. After the app ran for a couple days, the storage usage rapidly climbed until the device was full. 

 

Try checking the storage on the iOS device and see how much Powerapps is using. 

 

 

Thanks for the info. After my previous post, I went back and upped the Data Row limit to 2000 and it seems to have fixed it.

 

Odd in any case as I don't have near that many lines in any of my data sources (though my formulas may be doing something goofy), and of course the issue was only occurring on iOS devices.

 

Thanks again for the details.

 

 

New Member

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.

Be considerate while calling functions , also dry run is the best practice to prevent them. 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

In some programming languages this can be solved with tail call optimization, where the recursion call is transformed under the hood into a loop so no maximum stack size reached error exists.

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,990)