LoginSignup
2
0

More than 3 years have passed since last update.

解消法→Excessive stack depth comparing types 'MongoRepository<Entity>' and 'Repository<Entity>'.

Posted at

本稿ではtypeormのコンパイルで発生する「Excessive stack depth comparing types 'MongoRepository' and 'Repository'.」というエラーの解消法について伝える。

なお、この問題は発見されてから日が浅いため、より良い解消法が見つかる可能性がある。

僕の環境での発生状況

  • typeorm 0.2.18
  • typescript 3.6.2 (3.5.3では再現せず)

解消法1: typescript@3.5.3にダウングレードする

僕の環境では、typescript@3.5.3ではこの問題が発生しておらず、また、GitHubのissueでも3.5.3にダウングレードしたら解決したという報告が寄せられていることから効果があると考えられる。

解消法2: "skipLibCheck: true"をセットする

暫定措置として、tsconfig.jsonのcompilerOptions"skipLibCheck": trueをセットするとエラーを抑制できる。これはすべての*.d.tsファイルの型チェックをスキップするというもの。

tsconfig.json
{
  "compilerOptions": {
    // skipLibCheck is a temporary solution for https://github.com/typeorm/typeorm/issues/3194
    "skipLibCheck": true
  }
}

関連

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0