Open Closed

Maximum call size exceeded #3415


User avatar
0
papusa created

Hi!

We are having error on angular app page refresh: Error is present since ABP version 4.x.x. Now we are at 5.3.2 and the problem still exists. ERROR RangeError: Maximum call stack size exceeded at detectChangesInternal (http://localhost:4200/vendor.js:63247:9) at ViewRef$1.detectChanges (http://localhost:4200/vendor.js:73836:9) at SafeSubscriber._next (http://localhost:4200/vendor.js:24701:20) at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:13976:16) at SafeSubscriber.next (http://localhost:4200/vendor.js:13915:22) at Subscriber._next (http://localhost:4200/vendor.js:13865:26) at Subscriber.next (http://localhost:4200/vendor.js:13842:18) at DistinctUntilChangedSubscriber._next (http://localhost:4200/vendor.js:15724:30) at DistinctUntilChangedSubscriber.next (http://localhost:4200/vendor.js:13842:18) at MapSubscriber._next (http://localhost:4200/vendor.js:15951:26) {stack: "RangeError: Maximum call stack size exceeded\n a…._next (http://localhost:4200/vendor.js:15951:26)", message: "Maximum call stack size exceeded"} stack = "RangeError: Maximum call stack size exceeded\n at detectChangesInternal (http://localhost:4200/vendor.js:63247:9)\n at ViewRef$1.detectChanges (http://localhost:4200/vendor.js:73836:9)\n at SafeSubscriber._next (http://localhost:4200/vendor.js:24701:20)\n at SafeSubscriber.__tryOrUnsub (http://localhost:4200/vendor.js:13976:16)\n at SafeSubscriber.next (http://localhost:4200/vendor.js:13915:22)\n at Subscriber._next (http://localhost:4200/vendor.js:13865:26)\n at Subscriber.next (http://localhost:4200/vendor.js:13842:18)\n at DistinctUntilChangedSubscriber._next (http://localhost:4200/vendor.js:15724:30)\n at DistinctUntilChangedSubscriber.next (http://localhost:4200/vendor.js:13842:18)\n at MapSubscriber._next (http://localhost:4200/vendor.js:15951:26)" message = "Maximum call stack size exceeded" [[Prototype]] = Error defaultErrorLogger core.mjs:6494 handleError core.mjs:6541 next core.mjs:26174 __tryOrUnsub Subscriber.js:183 next Subscriber.js:122 _next Subscriber.js:72 next Subscriber.js:49 next Subject.js:39 emit core.mjs:22483 (anonymous function) core.mjs:25634 invoke zone.js:372 run zone.js:134 runOutsideAngular core.mjs:25507 onHandleError core.mjs:25634 handleError zone.js:376 runTask zone.js:181 invokeTask zone.js:487 ZoneTask.invoke zone.js:476 data.args.<computed> zone.js:2385 Async call from setTimeout scheduleTask zone.js:2387 scheduleTask zone.js:393 onScheduleTask zone.js:283 scheduleTask zone.js:386 scheduleTask zone.js:221 scheduleMacroTask zone.js:244 scheduleMacroTaskWithCurrentZone zone.js:683 (anonymous function) zone.js:2429 proto.<computed> zone.js:973 hostReportError hostReportError.js:2 __tryOrUnsub Subscriber.js:191 next Subscriber.js:122 _next Subscriber.js:72 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _subscribe BehaviorSubject.js:14 _trySubscribe Observable.js:42 _trySubscribe Subject.js:81 subscribe Observable.js:28 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 check abp-ng.core.mjs:1930 ngOnChanges abp-ng.core.mjs:1947 rememberChangeHistoryAndInvokeOnChangesHook core.mjs:1508 callHook core.mjs:2561 callHooks core.mjs:2520 executeInitAndCheckHooks core.mjs:2471 refreshView core.mjs:9510 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 detectChangesInternal core.mjs:10874 detectChanges core.mjs:21466 (anonymous function) abp-ng.core.mjs:1935 __tryOrUnsub Subscriber.js:183 next Subscriber.js:122 _next Subscriber.js:72 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _subscribe BehaviorSubject.js:14 _trySubscribe Observable.js:42 _trySubscribe Subject.js:81 subscribe Observable.js:28 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 check abp-ng.core.mjs:1930 ngOnChanges abp-ng.core.mjs:1947 rememberChangeHistoryAndInvokeOnChangesHook core.mjs:1508 callHook core.mjs:2561 callHooks core.mjs:2520 executeInitAndCheckHooks core.mjs:2471 refreshView core.mjs:9510 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 detectChangesInternal core.mjs:10874 detectChanges core.mjs:21466 (anonymous function) abp-ng.core.mjs:1935 __tryOrUnsub Subscriber.js:183 next Subscriber.js:122 _next Subscriber.js:72 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _next distinctUntilChanged.js:50 next Subscriber.js:49 _next map.js:35 next Subscriber.js:49 _subscribe BehaviorSubject.js:14 _trySubscribe Observable.js:42 _trySubscribe Subject.js:81 subscribe Observable.js:28 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call map.js:16 subscribe Observable.js:23 call distinctUntilChanged.js:11 subscribe Observable.js:23 check abp-ng.core.mjs:1930 ngOnChanges abp-ng.core.mjs:1947 rememberChangeHistoryAndInvokeOnChangesHook core.mjs:1508 callHook core.mjs:2561 callHooks core.mjs:2520 executeInitAndCheckHooks core.mjs:2471 refreshView core.mjs:9510 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 refreshView core.mjs:9519 refreshEmbeddedViews core.mjs:10646 Async call from Promise.then nativeScheduleMicroTask zone.js:561 scheduleMicroTask zone.js:572 scheduleTask zone.js:396 onScheduleTask zone.js:283 scheduleTask zone.js:386 scheduleTask zone.js:221 scheduleMicroTask zone.js:241 scheduleResolveOrReject zone.js:1265 resolvePromise zone.js:1202 (anonymous function) zone.js:1118 (anonymous function) zone.js:1134 webpackJsonpCallback jsonp chunk loading:77 (anonymous function) default…ared_module_ts.js:1

Issue seems to be related to route.provider.ts. We have more than 140 routes defined there. Not sure if there is a problem with routes amount or it's nesting level, but if I comment out few of them error disappears.

Thanks.

  • ABP Framework version: v5.3.2
  • UI type: Angular

3 Answer(s)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    The fix will available in the next version of 5.3. There is a workaround for this bug below:

    import { PermissionDirective } from '@abp/ng.core';
    import { Component } from '@angular/core';
    import { distinctUntilChanged, take } from 'rxjs/operators';
    import { ReplaySubject } from 'rxjs';
    @Component({
      selector: 'app-root',
      template: `
        &lt;abp-loader-bar&gt;&lt;/abp-loader-bar&gt;
        &lt;abp-dynamic-layout&gt;&lt;/abp-dynamic-layout&gt;
      `,
    })
    export class AppComponent {}
    
    function checkCustom() {
      if (this.subscription) {
        this.subscription.unsubscribe();
      }
    
      this.subscription = this.permissionService
        .getGrantedPolicy$(this.condition || '')
        .pipe(distinctUntilChanged())
        .subscribe(isGranted => {
          this.vcRef.clear();
          if (isGranted) this.vcRef.createEmbeddedView(this.templateRef);
          if (this.runChangeDetection) {
            if (!this.rendered) {
              this.cdrSubject.next();
            } else {
              this.cdRef.detectChanges();
            }
          } else {
            this.cdRef.markForCheck();
          }
        });
    }
    
    function after() {
      this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
      this.rendered = true;
    }
    PermissionDirective.prototype['check'] = checkCustom;
    PermissionDirective.prototype['ngAfterViewInit'] = after;
    
    PermissionDirective.prototype['cdrSubject'] = new ReplaySubject();
    PermissionDirective.prototype['rendered'] = false;
    
  • User Avatar
    0
    papusa created

    Hi.

    Thanks for help. Workaround fixed the issue. Any estimates regarding ABP update with fix?

  • User Avatar
    0
    muhammedaltug created

    Hello,

    The release date of the next version of 5.3 is not certain. I will notify you when the version is released.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38