Is this a regression?
The previous version in which this bug was not present was
21.2.5
Description
Description
Since upgrading to @angular/material@21.2.7, standalone components using Angular Material
imports produce the following compiler error:
'imports' must be an array of components, directives, pipes or NgModules.
Value could not be determined statically.
Affected imports that I tried
MatListModule from @angular/material/list
MatMenuModule from @angular/material/menu
MatButton from @angular/material/button
MatSlideToggle from @angular/material/slide-toggle
Workaround
Downgrading to @angular/material@21.2.5 resolves the issue.
Reproduction
import { MatSlideToggle } from '@angular/material/slide-toggle';
@Component({
selector: 'my-component',
imports: [ MatSlideToggle ],
templateUrl: './my-component.html',
})
export class MyComponent {}
Expected Behavior
No error. This worked correctly on 21.2.5.
Actual Behavior
Angular Language server error :
'imports' must be an array of components, directives, pipes or NgModules. Value could not be determined statically.
Environment
Environment
| Package |
Version |
@angular/material |
21.2.7 |
@angular/core |
21.2.0 |
@angular/cli |
21.2.5 |
| Node |
22.13.1 |
Is this a regression?
The previous version in which this bug was not present was
21.2.5
Description
Description
Since upgrading to
@angular/material@21.2.7, standalone components using Angular Materialimports produce the following compiler error:
Affected imports that I tried
MatListModulefrom@angular/material/listMatMenuModulefrom@angular/material/menuMatButtonfrom@angular/material/buttonMatSlideTogglefrom@angular/material/slide-toggleWorkaround
Downgrading to
@angular/material@21.2.5resolves the issue.Reproduction
Expected Behavior
No error. This worked correctly on
21.2.5.Actual Behavior
Angular Language server error :
'imports' must be an array of components, directives, pipes or NgModules. Value could not be determined statically.Environment
Environment
@angular/material@angular/core@angular/cli