Cannot resolve dependencies of module/service
See original GitHub issueI’m submitting a…
[x] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Totally broken, neither register
or registerAsync
works.
Can’t seem to resolve JWT_MODULE_OPTIONS
nor the dependencies in registerAsync
if that is used.
Error: Nest can't resolve dependencies of the JwtService (?). Please make sure that the argument at index [0] is available in the JwtModule context.
Expected behavior
Resolve JWT_MODULE_OPTIONS
.
Minimal reproduction of the problem with instructions
JwtModule.register({
secretOrPrivateKey: process.env.APP_SECRET,
}),
Environment
Nest version: 5.4.0
For Tooling issues:
- Node version: 10.9.0
- Platform: WSL
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Nest can't resolve dependencies of the PhotoService (?)
In your app.module.ts remove PhotoService from providers. Then in PhotoModule , just export PhotoService :
Read more >nest can't resolve dependencies of the - You.com
Nest can't resolve dependencies of the [ServiceName] ... But i am trying to re-use ElasticsearchService in another module/service called layout module.
Read more >Common errors - FAQ - A progressive Node.js framework
Common errors. During your development with NestJS, you may encounter various errors as you learn the framework. "Cannot resolve dependency" error#.
Read more >New module service is dependency on old ... - Drupal Answers
I have a new module moduleB. It defines a service that is used in the dependency injection of moduleA. moduleA is already enabled,...
Read more >Services and dependency injection in Drupal 8+
Another important benefit of dependency injection is that code will be ... If Drupal exceptionally cannot wire a service class for you, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had the same problem minuts ago. Here is the fix for me:
Problem was i both imported JwtModule and provided JwtService while JwtModule provide itself JwtService.
replace:
with:
How did you solve this problem?