codestates / codestates/Knock-Knock-Server

[ERROR] middleware, app.use() / TypeError: Router.use() requires a middleware function but got a Object

Open
#22 0 comments 0 reactions 0 assignees View on GitHub
bug errors
Dominant language
TypeScript
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

에러 종류 :middleware, app.use()

에러 메세지
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
TypeError: Router.use() requires a middleware function but got a Object

해결 방법 : import * as routes from "./routes";
- Routher.use()는 미들웨어를 필요로한다고 하는데, 도대체 뭘 빠트린지 알 수가 없었음. 그래서 위 문장을 적어넣었더니 해결!

참조 링크 :

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the middleware registration using app.use() and the ./routes import, then reproduce the Router.use() error and inspect the value being passed. The issue names no files or tests; done should be a clear diagnosis and a documented or verified correction for the reported import problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.