Components: Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming

Created on 23 May 2017  路  6Comments  路  Source: angular/components

Bug, feature request, or proposal:

Bug

What is the expected behavior?

No warning.

What is the current behavior?

Warning is shown.
Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming.
Anyway no styles are broken.

What are the steps to reproduce?

Use @import '~@angular/material/prebuilt-themes/indigo-pink'; in app.component.scss.

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

Angular 4.0.1
Material 2.0.0-beta.5

Is there anything else we should know?

Was working in Material 2.0.0-beta.2. Tried creating a custom theme, but still getting error message.

Most helpful comment

after searching i found this answer in stackoverflow and it worked for me

exports: [
MatButtonModule,
MatMenuModule,
MatToolbarModule,
MatIconModule,
MatCardModule
],
providers: [
{
provide: MATERIAL_SANITY_CHECKS,
useValue: false
}**
]

All 6 comments

Try importing the prebuilt theme into your global stylesheet

The warning is accurate- the stylesheet is meant to be added globally, rather than in the styleUrls of a component.

I can't import it in index.html, so is there another way to do that possibly using webpack ?

Still i get this error with 5.0.0-rc.1. all components are getting displayed but the warning in the console keeps coming.

Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming

I followed all the "Get started" instructions. is there anything i am missing. I am using webpack instead of systemjs.

any thoughts

after searching i found this answer in stackoverflow and it worked for me

exports: [
MatButtonModule,
MatMenuModule,
MatToolbarModule,
MatIconModule,
MatCardModule
],
providers: [
{
provide: MATERIAL_SANITY_CHECKS,
useValue: false
}**
]

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

xtianus79 picture xtianus79  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

Hiblton picture Hiblton  路  3Comments

julianobrasil picture julianobrasil  路  3Comments

vitaly-t picture vitaly-t  路  3Comments