-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(theming): 'Could not find Angular Material core theme' warning with new Angular 18 application using Angular Material #29115
Comments
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker. Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`. Fixes angular#29115.
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker. Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`. Fixes angular#29115.
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker. Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`. Fixes angular#29115.
I can confirm that I see the same warnings in the same environment |
It'll be fixed by #29118. |
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker. Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`. Fixes #29115.
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker. Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`. Fixes #29115. (cherry picked from commit 233c8a3)
Hi @crisbeto I am using Angular 18.0.1 I tried the above steps but still I see the warning appearing in devtools. Can you please help solving this. PFB the codebase for the same |
@Raghu0701 it looks like that project is on 18.0.0. You should update the package.json to be |
@crisbeto Thanks for your reply. I tried updating the packages using ng update command but still I see the in devtools. Additionally when I tried assigning primary color to navbar it has no effect on browser. have updated the code in the github repository Am I missing anything here ? please help as I am new to angular 18 |
@crisbeto I updated the angular material to the latest angular 18.0.2. Warning is still present. |
@comanescuadrian95 can you check in your For what it's worth, you can also disable the warning by providing this:
|
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When generating a new application and adding
@angular/material
with a custom theme, the following warning message is shown in the console:However, the core mixin is present in the
styles.scss
file:Attempting to include the core theme explicitly using
@include mat.core-theme($test-theme)
also has no effect.Reproduction
StackBlitz link: N/A (StackBlitz failed to run newly generated Angular 18 application)
Steps to reproduce:
ng new test-app
ng add @angular/material
app.component.html
with the following:MatButtonModule
to the imports array inapp.component.ts
Expected Behavior
No warning should be present.
Actual Behavior
The following warning is shown in the console:
The button added in the
app.component.html
renders as expected.Environment
The text was updated successfully, but these errors were encountered: