microsoft / microsoft/TypeScript

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

Đang mở
#61,583 3 bình luận 1 reaction 1 người được giao Xem trên GitHub

@sandersn đang làm issue này rồi.

Từ ngày 16/4/2025.

Bug Domain: Crashes
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

🔎 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.