-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedcross-cutting: standaloneIssues related to the NgModule-less worldIssues 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimearea: testingIssues related to Angular testing features, such as TestBedIssues related to Angular testing features, such as TestBedcross-cutting: standaloneIssues related to the NgModule-less worldIssues related to the NgModule-less worldstate: has PR