6

After Angular Material Migration from 14 to 15 this error appears:

Error: NG0300: Multiple components match node with tagname button: MatButton and MatIconButton

Ideas how this can be fixed?

Juri
  • 1,531
  • 2
  • 20
  • 43

2 Answers2

15

The reason was using mat-button and mat-icon-button on same element

<button [matMenuTriggerFor]="menu" mat-button mat-icon-button>

To resolve this just use only one.

Juri
  • 1,531
  • 2
  • 20
  • 43
3

This was my problem, I had both mat-icon-button and mat-raised-button on a single button.

<button mat-icon-button style="margin-top: 25px" mat-raised-button color="primary" >

When I removed mat-raised-button, its started working again. Thanks to the previous answer!

so-random-dude
  • 15,277
  • 10
  • 68
  • 113