Skip to content

bug(material): imports "could not be determined statically" error with MatListModule, MatMenuModule, MatButton in standalone components #33109

@BeckThomas2202

Description

@BeckThomas2202

Is this a regression?

  • Yes, this behavior used to work in the previous version

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: material/coregemini-triagedLabel noting that an issue has been triaged by geminineeds triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions