Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[api-extractor] Unable to analyze the export "Seq" when bundling immutable v5

オープン
#5,807 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
node.js, typescript

調査の方向性

Start with API Extractor's ExportAnalyzer._getExportOfAstModule and reproduce the failure using immutable@5.1.5, TypeScript 5.7.3, and the entry declaration described in the issue. Compare how Seq and its nested namespaces are resolved against immutable@4.x; done means the bundled .d.ts rollup succeeds and inlines immutable's declarations without the internal export-analysis error.

索引モデルが issue の本文から書いたものです。

説明

Summary

@microsoft/api-extractor crashes with an internal error when immutable (v5) is listed in bundledPackages. The crash happens during analysis of the Seq export and is reproducible against an unmodified immutable@5.1.5 install.

This blocks distributing a self-contained .d.ts rollup for any consumer that re-exports types from immutable v5. The same project bundled immutable@4.x without issue, so the regression is on the Immutable v5 declaration shape.

Repro steps

  1. npm i immutable@5.1.5 @microsoft/api-extractor@7.58.7 typescript@5.7.3

  2. Create an entry .d.ts that re-exports something from immutable, e.g.:

    import type { List } from 'immutable'
    export declare function getList(): List<string>
    
    
  3. In api-extractor.json set "bundledPackages": ["immutable"].

  4. Run api-extractor run --local --diagnostics.

Expected result: API Extractor inlines Immutable's declarations into the rollup, as it does for immutable@4.x.

Actual result:

ERROR: Internal Error: Unable to analyze the export "Seq" in node_modules/immutable/dist/immutable.d.ts

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Error: API Extractor failed with exit code 1

Details

The Immutable v5 declaration uses the same overall shape as v4 (declare namespace Immutable { … } export = Immutable; export as namespace Immutable;), but Seq and its nested namespaces (Seq.Keyed, Seq.Indexed, Seq.Set) are declared in a way that ExportAnalyzer._getExportOfAstModule can't resolve.

Workaround we ended up using: remove immutable from bundledPackages, let API Extractor emit import … from 'immutable', then post-process the rollup with a small script that inlines the namespace and rewrites the renamed imports (Immutable_2, Map_3, Set_2, …) to local aliases of the inlined namespace. Happy to share if it helps reproduce.

Related to (but distinct from) #2220, #1972, #5507, #5694. Those all surface the same generic "Unable to analyze the export" error from different triggers.

Standard questions

Question Answer
@microsoft/api-extractor version? 7.58.7
Operating system? macOS (also reproduces in Linux CI)
API Extractor scenario? rollups (.d.ts)
Would you consider contributing a PR? No (unfamiliar with ExportAnalyzer internals)
TypeScript compiler version? 5.7.3
Node.js version (node -v)? v24.13.0
主要言語
TypeScript
スター
6.5k
フォーク
708
平均マージ
5日 19時間
マージ済み PR(30日)
48

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

microsoft/rushstack のほかの issue

microsoft/rushstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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