-
-
Notifications
You must be signed in to change notification settings - Fork 7.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
Remove optional dependency metadata inherited from base class #2581
Comments
Thanks for this issue, I just got bit by this myself. |
Is someone working on this bug? I would like to take a look |
PRs are more than welcome! |
Still no update on this? |
@jmcdo29 wasn't this fixed by your PR nestjs/passport#824 |
Specifically for the |
I'm submitting a...
Current behavior
i extend AuthGuard with a custom Implementation that depends on a provider of an other module (e.g. config).
if i try to use that custom AuthGuard in an other module, i have to specify a dependency to the config module, although this is already done in the module of the custom guard.
After a long debug session i found out, that AuthGuard use an Optional Parameter. https://github.com/nestjs/passport/blob/8acdc04e6210aefab7a6e2ac4009e788bc8de5b8/lib/auth.guard.ts#L29
Which means the injector does nothing, because it can not resolve the dependency (config) and the parameter of the base-class (AuthGuard) has an Optional Parameter
nest/packages/core/injector/injector.ts
Line 269 in a330444
Expected behavior
Print out a clear Error message
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
In General i find that nestjs should be more verbose on handling dependencies. i spend a lot time debugging in the past
Environment
The text was updated successfully, but these errors were encountered: