We are developing web parts for SharePoint 2013 on-prem using Angular 2 and have come across the 'out of stack space' issue.
After spending time checking, double checking, adding and removing every permutation of polyfills that the interweb suggests, we are out of answers. Thinking perhaps it was something to do with our app, we used the latest version of angular2-seed, reworked the web part to load the bundled output and still we get the error.
The app(s) work. They work in IE 9>11 and Edge, that's not the problem. What does happen though is that they break parts of the SharePoint ribbon. Most notably the Site Settings menu. When you try and select a menu item, a hover event is triggered which is where we see the 'out of stack space' error. After the error occurs then further use of the ribbon is limited as the JavaScript fails to run again.
The error is getting raised from zone.js in our app and in the angular2-seed app, trying to run:
try {
return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);
}
catch (error) {
if (this._zoneDelegate.handleError(this, error)) {
throw error;
}
However this is not coming from our code. As I mentioned above, it is coming from SharePoint JavaScript. It seems that something in the polyfills and/or zone.js is overriding something that SharePoint needs.
We have been using AngularJS (ng1) for the last couple of years and haven't had a problem but we are creating our first Angular (ng2) app and we have come unstuck with IE/Edge.
Some of the other posts and bug reports in various Angular projects have suggested different combinations of polyfills and other modules but believe me, we have tried. And the issue isn't with our app but with SharePoint functionality. Any help will be appreciated.