Skip to content

bug(MatSlider): ERROR TypeError: Cannot read properties of undefined (reading '_hostElement') #29738

Closed
@ice909

Description

@ice909

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

No response

Description

<mat-slider min="1" max="5" step="0.5" value="1.5"></mat-slider>

Using this MatSlider component will print the following error in the console
image

Reproduction

StackBlitz link: https://material-14.angular.cn/guide/getting-started
Steps to reproduce:

  1. Following the official example, the console reports this error after MatSlider is displayed on the page

Expected Behavior

No error

Actual Behavior

error

Environment

  • Angular: 18.2.4
  • CDK/Material: 18.2.4
  • Browser(s): Chrome 128.0.6613.84
  • Operating System (e.g. Windows, macOS, Ubuntu): Linux Deepin v23

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/slider

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions