ngneat / effects

πŸͺ„ A framework-agnostic RxJS effects implementation
https://www.netbasal.com
MIT License
63 stars 11 forks source link

NullInjectorError: No provider for MatDialog #62

Closed jmeinlschmidt closed 1 year ago

jmeinlschmidt commented 1 year ago

Which @ngneat/effects-* package(s) are the source of the bug?

effects

Is this a regression?

No

Description

We've been using MatDialog in our effects. However, with this package, we cannot make it work (at least using the standalone API).

When invoking actions, an exception about missing provider is thrown. Is there any way to make this work?

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-ybh1gk

Please provide the exception or error you saw

NullInjectorError: NullInjectorError: No provider for MatDialog!
    at NullInjector.get (core.mjs:8760:27)
    at R3Injector.get (core.mjs:9189:33)
    at R3Injector.get (core.mjs:9189:33)
    at injectInjectorOnly (core.mjs:651:33)
    at Ι΅Ι΅inject (core.mjs:655:60)
    at inject (core.mjs:738:12)
    at new TodosEffects (todo.effects.ts:11:26)
    at Object.TodosEffects_Factory [as factory] (todo.effects.ts:10:26)
    at R3Injector.hydrate (core.mjs:9290:35)
    at R3Injector.get (core.mjs:9178:33)

Please provide the environment you discovered this bug in

elf-effects-matdialog@0.0.0
β”œβ”€β”€ @angular-devkit/build-angular@16.1.4
β”œβ”€β”€ @angular/animations@16.1.4
β”œβ”€β”€ @angular/cdk@16.1.4
β”œβ”€β”€ @angular/cli@16.0.6
β”œβ”€β”€ @angular/common@16.1.4
β”œβ”€β”€ @angular/compiler-cli@16.1.4
β”œβ”€β”€ @angular/compiler@16.1.4
β”œβ”€β”€ @angular/core@16.1.4
β”œβ”€β”€ @angular/forms@16.1.4
β”œβ”€β”€ @angular/material@16.1.4
β”œβ”€β”€ @angular/platform-browser-dynamic@16.1.4
β”œβ”€β”€ @angular/platform-browser@16.1.4
β”œβ”€β”€ @angular/router@16.1.4
β”œβ”€β”€ @ngneat/effects-ng@3.1.3
β”œβ”€β”€ @ngneat/effects@2.1.2
β”œβ”€β”€ @types/jasmine@4.3.5
β”œβ”€β”€ jasmine-core@4.6.0
β”œβ”€β”€ karma-chrome-launcher@3.2.0
β”œβ”€β”€ karma-coverage@2.2.1
β”œβ”€β”€ karma-jasmine-html-reporter@2.0.0
β”œβ”€β”€ karma-jasmine@5.1.0
β”œβ”€β”€ karma@6.4.2
β”œβ”€β”€ rxjs@7.8.1
β”œβ”€β”€ tslib@2.6.0
β”œβ”€β”€ typescript@5.0.4
└── zone.js@0.13.1

Anything else?

No response

Do you want to create a pull request?

No

stackblitz[bot] commented 1 year ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

jmeinlschmidt commented 1 year ago

It is not really related to this package. The workaround for me is to provide the missing MatDialogModule in bootstrapApplication via importProvidersFrom([MatDialogModule]).

Working solution here https://stackblitz.com/edit/stackblitz-starters-9yvejp.