Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[api-extractor] "ERROR: Internal Error: Unable to analyze the export" when using `var`

Đang mở
#5,507 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Start with the linked minimal reproduction, tale-of-export-var-and-api-extractor, and run API Extractor against its exported var declaration using the reported TypeScript and Node.js versions. Trace the API Extractor analysis path that produces the reported internal error; done means the reproduction succeeds and the exported variable is handled without that error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

I want to run api-extractor on a package interface which includes exported var values, which in d.ts manifest as
export declare var __name__: __type__

Repro steps

Minimal repro:
https://github.com/kuhe/tale-of-export-var-and-api-extractor

Expected result:

API extractor succeeds.

Actual result:

Error message:

ERROR: Internal Error: Unable to analyze the export "zero" in
/Users/***/workspace/tale-of-declare-var-and-api-extractor/lib/index.d.ts

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

Details

Perhaps the initial reaction will be, like in https://github.com/microsoft/rushstack/issues/3353, that export var is not "recommended".
But I think that should not be up to this library, but rather the user. My team had started using api-extractor for documentation, and now find that we are unable to export vars, but unable to remove api-extractor as a dependency at the moment.

As a workaround, we will likely convert the vars into consts or lets, but shouldn't have to.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.55.2
Operating system? Linux
API Extractor scenario? docs (.api.json)
Would you consider contributing a PR? Yes, if confirmed as unintentional
TypeScript compiler version? 5.9.3
Node.js version (node -v)? 20.5.1
Ngôn ngữ chính
TypeScript
Star
6.5k
Fork
708
Merge trung bình
4 ngày 13 giờ
Pull request đã merge (30 ngày)
62

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Issue khác của microsoft/rushstack

Tất cả issue của microsoft/rushstack

Issue tương tự

Thêm issue về TypeScript

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.