Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nest can't resolve dependencies of the PhotoService (?)

Tags:

I'm starting with Nest.js and I'm getting an error after I create a service:

Nest can't resolve dependencies of the PhotoService (?). Please verify whether [0] argument is available in the current context.

I'm following the database example: https://docs.nestjs.com/techniques/database

Here is my full code: https://github.com/marceloHashzen/nestjsbasics

like image 834
Marcelo Tardelli Magalhães Avatar asked Jun 12 '18 01:06

Marcelo Tardelli Magalhães


1 Answers

In your app.module.ts remove PhotoService from providers. Then in PhotoModule, just export PhotoService:

@Module({
  // ...prev code
  exports: [PhotoService],
})
like image 96
Vladyslav Moisieienkov Avatar answered Sep 18 '22 13:09

Vladyslav Moisieienkov