오류 일기.

김부릉·2023년 4월 25일
0
  1. Error connecting to database: TypeError: Class constructor BaseEntity cannot be invoked without 'new'
  • 엔티티를 만들던 와중에 갑자기 나타난 영문 모를 에러였는데 아무리봐도 new를 써서 인스턴스 생성할 문제는 아니었다. tsconfig.json 에서 es5였던 "target"을 es6로 수정하니까 됐다. typeorm import 할 때 인식이 안된 이유였다.
  1. Error connecting to database: entities/User.ts:11:7 - error TS6196: 'User' is declared but never used.
  • export default User 안해줘서 자꾸 뜨는 문제
  1. @OneToMany(type => Message, message => message.chat)
    'type' is declared but its value is never read.
  • tsconfig.json 에서 "noUnusedParameters": true 를 삭제했다. noUnusedParameters는 함수에서 사용되지 않는 매개변수에 대한 오류 보고이다.
  1. Argument of type '{ fbId: string; }' is not assignable to parameter of type 'FindOneOptions'.
  • typeorm이 3버전이 되면서 findOneBy - Finds the first entity that matches given FindOptionsWhere. where절 없이 사용하려면 findOneBy()를 쓴다.

0개의 댓글