해결된 질문
작성
·
790
0
안녕하세요 제로초님, 현재 5-14 include와 as, foreign key 강의 보고 있습니다.
다른 게 아니라 로그인 시도시 아래와 같은 에러가 뜹니다.
Executing (default): SELECT `id`, `nickname`, `userId`, `password`, `createdAt`, `updatedAt` FROM `Users` AS `User` WHERE `User`.`userId` = 'degurii';
Error: Include unexpected. Element has to be either a Model, an Association or an object.
at Function._conformInclude (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:390:11)
at options.include.options.include.map.include (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:326:59)
at Array.map (<anonymous>)
at Function._conformIncludes (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:326:39)
at Function._baseMerge (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:791:10)
at Function._defaultsOptions (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:828:17)
at Function._injectScope (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:3288:10)
at Promise.try (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:1707:12)
at tryCatcher (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\bluebird\js\release\util.js:16:23)
at Function.Promise.attempt.Promise.try (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\bluebird\js\release\method.js:39:29)
at Function.findAll (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:1706:23)
at Function.findOne (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\sequelize\lib\model.js:1924:17)
at req.login (C:\Users\Yunseok\Documents\projects\node-bird\backend\routes\user.js:59:40)
at C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\http\request.js:52:7
at C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\sessionmanager.js:26:5
at pass (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\authenticator.js:277:43)
at serialized (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\authenticator.js:286:7)
at passport.serializeUser (C:\Users\Yunseok\Documents\projects\node-bird\backend\passport\index.js:8:12)
at pass (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\authenticator.js:294:9)
at Authenticator.serializeUser (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\authenticator.js:299:5)
at SessionManager.logIn (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\sessionmanager.js:14:8)
at IncomingMessage.req.login.req.logIn (C:\Users\Yunseok\Documents\projects\node-bird\backend\node_modules\passport\lib\http\request.js:50:33)
POST /api/user/login 500 276.041 ms - 3175
혹시 어느 부분이 잘못됐는지 알 수 있을까요?? 깃허브 코드와 비교해봐도 다른 부분을 찾지 못했습니다.
models/user.js
routes/user.js