해결된 질문
작성
·
734
답변 8
0
0
0
routes> user.js 22번째 email: req.body.nickname, => email.req.body.email로 고쳐주었습니다.
그런데 그 다음에도 이러한 에러가 발생하네요. 그리고 회원가입버튼을 누르고 다음페이지로 넘어가지도 않습니다. MySQL테이블에도 기존거 왜에 새로 생기지가 않네요.
0
0
네, table 새로고침해서 확인해보니 email 자리와 nickname자리에 같이 laney라고 등록되어 잇네요? front>page>signup.js 에가서 github 마스터 브랜치에 있는 코드 보고 최대한 같게 고쳐주었는데요 , 그다음에는 어디를 확인해야 하나요? 현제 화면은 이렇게 나옵니다.
0
서버쪽 VSCode terminal에는 이렇게 나옵니다.
db 연결 성공
Executing (default): SELECT `id`, `email`, `nickname`, `password`, `createdAt`, `updatedAt` FROM `Users` AS `User` WHERE `User`.`email` = 'pm1111@gmail.com';
Executing (default): INSERT INTO `Users` (`id`,`email`,`nickname`,`password`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?,?,?);
Error
at Query.run (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\dialects\mysql\query.js:52:25)
at C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\sequelize.js:313:28
at async MySQLQueryInterface.insert (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\dialects\abstract\query-interface.js:297:21)
at async model.save (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\model.js:2417:35)
at async Function.create (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\model.js:1329:12)
at async C:\Users\pm722\react-avocode\prepare\back\routes\user.js:19:3 {
name: 'SequelizeUniqueConstraintError',
errors: [
ValidationErrorItem {
message: 'email must be unique',
type: 'unique violation',
path: 'email',
value: 'laney',
origin: 'DB',
instance: [User],
validatorKey: 'not_unique',
validatorName: null,
validatorArgs: []
}
],
parent: Error: Duplicate entry 'laney' for key 'users.email'
at Packet.asError (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\packets\packet.js:728:17)
at Execute.execute (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\commands\command.js:29:26)
at Connection.handlePacket (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:456:32)
at PacketParser.onPacket (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:85:12)
at PacketParser.executeStart (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\packet_parser.js:75:16)
at Socket.<anonymous> (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:92:25)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10) {
code: 'ER_DUP_ENTRY',
errno: 1062,
sqlState: '23000',
sqlMessage: "Duplicate entry 'laney' for key 'users.email'",
sql: 'INSERT INTO `Users` (`id`,`email`,`nickname`,`password`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?,?,?);',
parameters: [
'laney',
'laney',
'$2b$12$kkf1ugWu4MkePosExlH4..lo8O2ta6raxP5LZridjhXp71YSteww.',
'2022-03-04 06:39:42',
'2022-03-04 06:39:42'
]
},
original: Error: Duplicate entry 'laney' for key 'users.email'
at Packet.asError (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\packets\packet.js:728:17)
at Execute.execute (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\commands\command.js:29:26)
at Connection.handlePacket (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:456:32)
at PacketParser.onPacket (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:85:12)
at PacketParser.executeStart (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\packet_parser.js:75:16)
at Socket.<anonymous> (C:\Users\pm722\react-avocode\prepare\back\node_modules\mysql2\lib\connection.js:92:25)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at Socket.Readable.push (node:internal/streams/readable:228:10) {
code: 'ER_DUP_ENTRY',
errno: 1062,
sqlState: '23000',
sqlMessage: "Duplicate entry 'laney' for key 'users.email'",
sql: 'INSERT INTO `Users` (`id`,`email`,`nickname`,`password`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?,?,?);',
parameters: [
'laney',
'laney',
'$2b$12$kkf1ugWu4MkePosExlH4..lo8O2ta6raxP5LZridjhXp71YSteww.',
'2022-03-04 06:39:42',
'2022-03-04 06:39:42'
]
},
fields: { email: 'laney' },
sql: 'INSERT INTO `Users` (`id`,`email`,`nickname`,`password`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?,?,?);'
}
Error
at Query.run (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\dialects\mysql\query.js:52:25)
at C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\sequelize.js:313:28
at async MySQLQueryInterface.insert (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\dialects\abstract\query-interface.js:297:21)
at async model.save (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\model.js:2417:35)
at async Function.create (C:\Users\pm722\react-avocode\prepare\back\node_modules\sequelize\lib\model.js:1329:12)
at async C:\Users\pm722\react-avocode\prepare\back\routes\user.js:19:3
0
0