Skip to content
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

Nest can't resolve dependencies of the UsersService #1

Closed
thinkflo opened this issue May 3, 2021 · 1 comment
Closed

Nest can't resolve dependencies of the UsersService #1

thinkflo opened this issue May 3, 2021 · 1 comment

Comments

@thinkflo
Copy link

thinkflo commented May 3, 2021

Following the Readme, getting the following error:

> [email protected] start
> ts-node -r tsconfig-paths/register src/main.ts

[Nest] 5198   - 05/03/2021, 7:27:29 PM   [NestFactory] Starting Nest application...
[Nest] 5198   - 05/03/2021, 7:27:30 PM   [InstanceLoader] ApplicationModule dependencies initialized +121ms
[Nest] 5198   - 05/03/2021, 7:27:30 PM   [InstanceLoader] SequelizeModule dependencies initialized +0ms
[Nest] 5198   - 05/03/2021, 7:27:30 PM   [ExceptionHandler] Nest can't resolve dependencies of the UsersService (?). Please make sure that the argument UsersRepository at index [0] is available in the UsersModule context.

Potential solutions:
- If UsersRepository is a provider, is it part of the current UsersModule?
- If UsersRepository is exported from a separate @Module, is that module imported within UsersModule?
  @Module({
    imports: [ /* the Module containing UsersRepository */ ]
  })
 +2ms
Error: Nest can't resolve dependencies of the UsersService (?). Please make sure that the argument UsersRepository at index [0] is available in the UsersModule context.

Potential solutions:
- If UsersRepository is a provider, is it part of the current UsersModule?
- If UsersRepository is exported from a separate @Module, is that module imported within UsersModule?
  @Module({
    imports: [ /* the Module containing UsersRepository */ ]
  })
@jengel3
Copy link
Owner

jengel3 commented May 3, 2021

It looks like I forgot to add the UsersRepository to the module's providers list. I pushed a fix - give it a try!

@jengel3 jengel3 closed this as completed May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant