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.

Cannot resolve dependencies of module/service

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

10reactions
PierreDemaillycommented, Jan 30, 2020

How did you solve this problem?

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:

imports: [JwtModule],
providers: [JwtService]

with:

imports: [JwtModule]
7reactions
Shinigami92commented, Dec 21, 2018

How did you solve this problem?

Read more comments on GitHub >

github_iconTop 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 >

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