Repository navigation
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedcross-cutting: standaloneIssues related to the NgModule-less worldstate: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Importing a recursive cycle of standalone components into TestBed.configureTestingModule causes an infinite loop in queueTypesFromModulesArrayRecur.
Please provide a link to a minimal reproduction of the bug
angular/packages/core/test/acceptance/standalone_spec.ts
Lines 370 to 400 in 8d99ad0
| it('should render a recursive cycle of standalone components', () => { | |
| @Component({ | |
| selector: 'cmp-a', | |
| standalone: true, | |
| template: '<ng-template [ngIf]="false"><cmp-c></cmp-c></ng-template>A', | |
| imports: [forwardRef(() => StandaloneCmpC)], | |
| }) | |
| class StandaloneCmpA { | |
| } | |
| @Component({ | |
| selector: 'cmp-b', | |
| standalone: true, | |
| template: '(<cmp-a></cmp-a>)B', | |
| imports: [StandaloneCmpA], | |
| }) | |
| class StandaloneCmpB { | |
| } | |
| @Component({ | |
| selector: 'cmp-c', | |
| standalone: true, | |
| template: '(<cmp-b></cmp-b>)C', | |
| imports: [StandaloneCmpB], | |
| }) | |
| class StandaloneCmpC { | |
| } | |
| const fixture = TestBed.createComponent(StandaloneCmpC); | |
| fixture.detectChanges(); | |
| expect(fixture.nativeElement.textContent).toBe('((A)B)C'); |
Right before the TestBed.createComponent, add TestBed.configureTestingModule({imports: [StandaloneCmpC]});
Please provide the exception or error you saw
RangeError: Maximum call stack size exceeded
at queueTypesFromModulesArrayRecur
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedcross-cutting: standaloneIssues related to the NgModule-less worldstate: has PR
Activity
[-]Importing[/-][+]Importing a recursive cycle of standalone components into TestBed.configureTestingModule causes an infinite loop in[/+][-]Importing a recursive cycle of standalone components into TestBed.configureTestingModule causes an infinite loop in[/-][+]Importing a recursive cycle of standalone components into TestBed.configureTestingModule causes an infinite loop[/+][-]Importing a recursive cycle of standalone components into TestBed.configureTestingModule causes an infinite loop[/-][+]Importing a recursive cycle of standalone components into TestBed causes an infinite loop[/+]fix(core): Allow `TestBed.configureTestingModule` to work with recurs…
angular-automatic-lock-bot commentedon Apr 20, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.