Ignite UI for Angular is a complete library of Angular-native, Material-based Angular UI components with the fastest grids and charts, Pivot Grid, Dock Manager, Hierarchical Grid, and more.
The IgxCarouselComponent causes a ReferenceError: Cannot access 'IgxCarouselComponent' before initialization error during testing, even though IgxCarouselComponent is not explicitly imported or used anywhere in the codebase. The error occurs when testing components that use other Ignite UI components, such as IgxSwitchComponent.
igniteui-angular version:
"@infragistics/igniteui-angular": "18.2.2",
"igniteui-angular-core": "18.1.1",
"igniteui-angular-excel": "18.1.1",
"igniteui-angular-spreadsheet": "18.1.1",
"igniteui-angular-charts": "18.1.1",
(everything is the latest package)
browser: Not browser-specific; occurs during unit tests in the Angular testing environment.
Steps to reproduce
Create a component that imports and uses IgxSwitchComponent or other Ignite UI components (e.g., IgxButtonDirective, IgxToggleDirective).
Set up a unit test for this component using @angular/core/testing and @testing-library/angular.
Run the test.
Result
A ReferenceError: Cannot access 'IgxCarouselComponent' before initialization error appears in the test output, even though IgxCarouselComponent is not used directly. The error prevents tests from running successfully.
Expected result
The test should run without attempting to initialize or reference IgxCarouselComponent, as it is not explicitly imported or used in the test or the component code.
Attachments
Here is a sample error message:
ReferenceError: Cannot access ‘IgxCarouselComponent’ before initialization
at Object. (node_modules/@infragistics/igniteui-angular/fesm2022/infragistics-igniteui-angular.mjs:34362:172)
at Object. (src/app/feature-modules/forms/fields/j-custom-selection-field-editor/j-custom-selection-field-editor.component.ts:7:1)
at Object. (src/app/feature-modules/forms/fields/j-custom-selection-field-editor/j-custom-selection-field-editor.component.spec.ts:4:1)
This issue occurs in Angular unit tests for components that include Ignite UI components, even when IgxCarouselComponent is not part of the component or test dependencies.
Description
The
IgxCarouselComponent
causes aReferenceError: Cannot access 'IgxCarouselComponent' before initialization
error during testing, even thoughIgxCarouselComponent
is not explicitly imported or used anywhere in the codebase. The error occurs when testing components that use other Ignite UI components, such asIgxSwitchComponent
.igniteui-angular version: "@infragistics/igniteui-angular": "18.2.2", "igniteui-angular-core": "18.1.1", "igniteui-angular-excel": "18.1.1", "igniteui-angular-spreadsheet": "18.1.1", "igniteui-angular-charts": "18.1.1", (everything is the latest package)
browser: Not browser-specific; occurs during unit tests in the Angular testing environment.
Steps to reproduce
IgxSwitchComponent
or other Ignite UI components (e.g.,IgxButtonDirective
,IgxToggleDirective
).@angular/core/testing
and@testing-library/angular
.Result
A
ReferenceError: Cannot access 'IgxCarouselComponent' before initialization
error appears in the test output, even thoughIgxCarouselComponent
is not used directly. The error prevents tests from running successfully.Expected result
The test should run without attempting to initialize or reference
IgxCarouselComponent
, as it is not explicitly imported or used in the test or the component code.Attachments
Here is a sample error message:
This issue occurs in Angular unit tests for components that include Ignite UI components, even when
IgxCarouselComponent
is not part of the component or test dependencies.