Components: 'mat-select' is not a known element

Created on 3 Jun 2018  路  6Comments  路  Source: angular/components

Bug, feature request, or proposal:

bug

What is the expected behavior?

No error

What is the current behavior?

I upgraded from angular 4 to 6
After that when running project I get error:

'mat-select' is not a known element:
1. If 'mat-select' is an Angular component, then verify that it is part of this module.
2. If 'mat-select' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("-form-field>
<mat-form-field>
    [ERROR ->]<mat-select formControlName="provinceFormControl" placeholder="Provincia" name="country_shipping"

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular CLI: 6.0.7
Node: 8.11.2
OS: win32 x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.6.7
@angular-devkit/build-angular 0.6.7
@angular-devkit/build-optimizer 0.6.7
@angular-devkit/core 0.6.7
@angular-devkit/schematics 0.6.7
@angular/cdk 6.2.0
@angular/cli 6.0.7
@angular/material 6.2.0
@ngtools/webpack 6.0.7
@schematics/angular 0.6.7
@schematics/update 0.6.7
rxjs 6.2.0
typescript 2.7.2
webpack 4.10.2

Is there anything else we should know?

I moved every
<mat-select>
inside a
<mat-form-field>
and addedd import for MatFormFieldModule in app.module

Most helpful comment

You also have to import the MatSelectModule.

All 6 comments

You also have to import the MatSelectModule.

At first that import gave me error, don't know why...now it works

thanks

I used for material version 6.4.7 and it worked. Then i started a project with version 5.2.4 and it gives this error.

@crisbeto import MatSelectModule, _where_?

@ORESoftware In app.module.ts file -
@NgModule({
declarations: [
AppComponent
],
imports: [ MatSelectModule ]

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jelbourn picture jelbourn  路  171Comments

MariovanZeist picture MariovanZeist  路  59Comments

anderflash picture anderflash  路  59Comments

jelbourn picture jelbourn  路  94Comments

lfroment0 picture lfroment0  路  108Comments