codestates / codestates/Dawn-on-server

[Error] 2021-05-19 inject,forFeature 지정오류

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
[Done] YoungHo Error 핸들링 Nest.js Type ORM
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### **어떤 에러인가요?**

- Service에서 inject설정 안한 오류
- moduled에서 TypeOrmModule.forFeature를 지정하지 않아 생긴 오류

### **에러 메시지**

`Nest can't resolve dependencies of the TokenService (UsersRepository, JwtService, UsersService, ?). Please make sure that the argument RefreshTokenRepository at index [3] is available in the AuthModule context.`

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

### **에러 핸들링 방법**

- 사용한 데이터베이스를 forFeature안에 지정해서 모듈러에 남겨준다.
`// 코드가 들어가도 좋아요!`

### **에러 핸들링을 위해 참고한 레퍼런스 링크**

없음.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the AuthModule and TokenService dependency setup, especially RefreshTokenRepository and the TypeOrmModule.forFeature configuration. Confirm that the database entity is registered for the module and that the dependency-resolution error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, nodejs, typescript
Domain
backend, database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.