작성
·
283
0
제목과 같이 serializeUser를 강의와 같이 작성시 아래와 같은 에러가 발생합니다.
해당 에러를 해석 했을 때, serializeUser의 함수 정의는 Express.User로 되어 있는 것 같습니다.
No overload matches this call.
Overload 1 of 2, '(fn: (user: User, done: (err: any, id?: unknown) => void) => void): void', gave the following error.
Argument of type '(user: import("c:/Users/shinj/Desktop/nodebird/back/models/user").default, done: (err: any, id?: unknown) => void) => void' is not assignable to parameter of type '(user: Express.User, done: (err: any, id?: unknown) => void) => void'.
Types of parameters 'user' and 'user' are incompatible.
Type 'User' is missing the following properties from type 'User': id, nickname, userId, password, and 31 more.
Overload 2 of 2, '(fn: (req: IncomingMessage, user: User, done: (err: any, id?: unknown) => void) => void): void', gave the following error.
Argument of type '(user: User, done: (err: any, id?: unknown) => void) => void' is not assignable to parameter of type '(req: IncomingMessage, user: User, done: (err: any, id?: unknown) => void) => void'.
Types of parameters 'user' and 'req' are incompatible.
Type 'IncomingMessage' is missing the following properties from type 'User': id, nickname, userId, password, and 30 more.ts(2769)
강의 때 만든 models/user를 사용하기 위해서는 어떻게 해야하나요? github에 올라온 자료를 참고하면 해당 코드를 아래와 같이 풀어 가셨던데, 아래 코드로 작성해도 에러가 나서 문의 드립니다.