• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

node. app.js 실행시 error 발생.

23.05.09 16:40 작성 조회수 249

0

안녕하세요!

models 구성하고, app.js 로 db import도 다 했는데, node app.js 실행하면 다음과 같은 에러 메세지가 뜹니다.

Post.belongsToMany called with something that's not a subclass of Sequelize.Model

models에서 user, hashtag export 가 잘못된거 같아서 다 확인했는데, 문제를 못찾았습니다.

어떤 부분이 잘 못된걸까요?
Screenshot 2023-05-09 at 1.37.58 AM.pngScreenshot 2023-05-09 at 1.39.54 AM.png

감사합니다.

 

답변 2

·

답변을 작성해보세요.

0

답변 감사합니다!

0

models/index.js도 보여주세요

Screenshot 2023-05-09 at 9.13.11 AM.pngmodels/index.js 입니다.

모델이 옛날 방식으로 생성되어 있어서 잘 모르겠네요.

https://github.com/ZeroCho/react-nodebird/tree/master/ch5/back/models

여기에 따라서 최신 방식으로 전부 다 수정하시는 게 나을 것 같습니다.