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.

StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]

See original GitHub issue

Bug, feature request, or proposal:

Bug?? Either that or Ive done something wrong

What is the expected behavior?

No error when loading

What is the current behavior?

On app startup Im seeing:

StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]

Full error is: core.js:12301 ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]: StaticInjectorError(Platform: core)[MatDialogTitle -> MatDialogRef]: NullInjectorError: No provider for MatDialogRef! Error: StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]: StaticInjectorError(Platform: core)[MatDialogTitle -> MatDialogRef]: NullInjectorError: No provider for MatDialogRef! at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:691) at resolveToken (core.js:928) at tryResolveToken (core.js:872) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:769) at resolveToken (core.js:928) at tryResolveToken (core.js:872) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:769) at resolveNgModuleDep (core.js:17435) at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:18124) at resolveDep (core.js:18495) at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:691) at resolveToken (core.js:928) at tryResolveToken (core.js:872) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:769) at resolveToken (core.js:928) at tryResolveToken (core.js:872) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:769) at resolveNgModuleDep (core.js:17435) at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:18124) at resolveDep (core.js:18495) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:13842) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595) at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:500) at invokeTask (zone.js:1540)

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

Angular Material: 6.4.7 and 7.0 Angular 7.0.2 Windows 10 Typescript 3.0.3 Chrome

Is there anything else we should know?

Everything was fine until I updated to Angular 6.4.7 (and whatever version of Material went with that). Tried v 7 and no difference.

Ive checked that Im refering to MatDialogModule everywhere but I dont fully understand what the issue is since the error message ios somewhat cryptic.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Jonesiecommented, Oct 27, 2018

I was really just looking for an explanation of the problem, not a solution. Stackoverflow is next to useless for complex issues like this. The people here are usually the most informed and knowledgeable, and therefore the most overworked I guess.

1reaction
Jonesiecommented, Oct 25, 2018

I tried the solutions offered here: https://stackoverflow.com/questions/52885991/staticinjectorerrorappmodulematdialogtitle-matdialogref/52975331#52975331 and here: https://github.com/angular/material2/issues/8419.

i.e., I added this to my MaterialModule:

providers: [ { provide: MatDialogTitle, useValue: {} }, { provide: MatDialogRef, useValue: {} }, { provide: MAT_DIALOG_DATA, useValue: [] } ] This removes the error message from the console, but now my application started up and show the content of a dialog as the home page.

Read more comments on GitHub >

github_iconTop Results From Across the Web

StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]
Update: So for my issue, I was able to solve it using providers from this Bug issue [https://github.com/angular/material2/issues/8419].
Read more >
angular/material2 - Gitter
Error: StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]: StaticInjectorError(Platform: core)[MatDialogTitle -> MatDialogRef]: ...
Read more >
Angular Material Dialog: A Complete Example
mat-dialog-title : This identifies the title of the dialog, in this case ... StaticInjectorError(AppModule)[MatDialogTitle -> MatDialogRef]:
Read more >
Nullinjectorerror: No Provider For Matdialogref - ADocLib
Error: StaticInjectorError[ActivatedRoute]: No provider for , Hi, I have "generator-angular2-library" template, and then NullInjectorError: No provider ...
Read more >
Angular – NullInjectorError: No provider for MatDialogRef
When i'm trying to do it i'v got error: ERROR Error: StaticInjectorError[MatDialogRef]: StaticInjectorError[MatDialogRef]: NullInjectorError: No provider for ...
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