Node.js
TypeError: "x" is not a constructor
akinakamori
2022. 2. 13. 01:06
728x90
SMALL
const { User } = require('./models/User');
라고 적었는데도
const user = new User(req.body);
에서 'TypeError: User is not a constructor'라는 에러를 얻었다.
module.exports = { User };
가 정확히 작성되지 않았음.
728x90
LIST