microsoft / microsoft/TypeScript

Internal error in tsc: "TypeError: Cannot read properties of undefined (reading 'flags')"

オープン
#61,583 コメント 3 件 リアクション 1 件 担当者 1 名 GitHub で見る

@sandersn がすでに取り組んでいます。

2025年4月16日 から。

Bug Domain: Crashes
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

🔎 Search Terms

TypeError: Cannot read properties of undefined (reading 'flags')

🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about unhandled TypeScript errors
⏯ Repository Link

https://github.com/GaurangTandon/tsc-issue-repro

💻 Code
const UPDATE_MARKER_FUNC = 'updateMarkerPosition';
window[UPDATE_MARKER_FUNC] = (coordinates, color = 'red') => {};
🙁 Actual behavior
/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:122142
      throw e;
      ^

TypeError: Cannot read properties of undefined (reading 'flags')
    at getMembersOfSymbol (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:56777:19)
    at getLateBoundSymbol (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:56787:11)
    at getSymbolOfDeclaration (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:49588:43)
    at getSymbolOfNode (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:49591:34)
    at getFunctionExpressionParentSymbolOrSymbol (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:49598:198)
    at getResolvedMembersOrExportsOfSymbol (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:56742:27)
    at getExportsOfSymbol (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:49486:61)
    at resolveAnonymousTypeMembers (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:57350:19)
    at resolveStructuredTypeMembers (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:57698:11)
    at getSignaturesOfStructuredType (/Users/blazegt/test-tsc/node_modules/typescript/lib/_tsc.js:58389:24)

Node.js v20.18.3
🙂 Expected behavior

Internal TypeScript errors should not be thrown.

Additional information about the issue

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。