question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hi! Ciao! How Are You???

Bug, feature request, or proposal:

Could not find Angular Material core theme, although all core @include mat-core(); is included. I got 6 themes, all working except the warning.

What is the expected behavior?

No warning.

What is the current behavior?

Warning.

What are the steps to reproduce?

git clone https://github.com/patrikx3/corifeus-app-web-pages.git
cd corifeus-app-web-pages
yarn install
grunt run

See.

What is the use-case or motivation for changing an existing behavior?

Themes.

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

Current.

Is there anything else we should know?

Nope.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

31reactions
MikeInSwitzerlandcommented, Jun 19, 2017

This issue tied me in knots, but eventually, I realised that what Angular’s own Materials tutorial doesn’t tell us is that we must include this line in the “styles.css” file, to make the controls appear normally (certainly in Windows 7).

@import “…/node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css”;

Trying to include that file using an “include”, even in the index.html file, failed miserably for me. It could never locate this .css file… even if I manually copied it into the same folder as index.html.

13reactions
siebmanbcommented, Aug 18, 2017

@sharpevo thanks a lot for your help. I had the issue when running tests using karma. Your fix does not work for this use case, however adding the theme file in karma.conf.js as follows fixes the issue

files: [
            {pattern: './src/test.ts', watched: false},
            'node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css'
        ],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular material Could not find Angular Material core theme
1) Import this (or other) Material theme into your main css file: @import "../node_modules/@angular/material/prebuilt-themes/deeppurple-amber.
Read more >
Fixing Could not find Angular Material core theme error in ...
To fix “Could not find Angular Material core theme” error in Angular material import or add any of the below prebuilt themes (or...
Read more >
Could not find Angular Material core theme [Solved] - YouTube
In this video i will show you how resolve Could not find Angular Material core theme problem which many developer face while working...
Read more >
angular/material2 - Gitter
Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming.
Read more >
Theming Angular Material
Angular Material comes prepackaged with several pre-built theme css files. These theme files also include all of the styles for core (styles common...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found