microsoft / microsoft/TypeScript

Module AMD and outFile causes declaration emit to use module that does not exist

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

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

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

TypeScript Version: 3.5.1, 3.7.5, 3.8.3

Search Terms: module, amd, outFile, declaration emit

Code

git clone https://github.com/AnyhowStep/tsql.git
cd tsql
git checkout e5a0d16ac31d868f03386b4381e51eed5f6c731d
npm install
./node_modules/.bin/tsc -m amd --outFile test-amd.js
  1. You should now see a test-amd.d.ts file.
  2. Open test-amd.d.ts with VS code or something.
  3. Set VS code to use the TypeScript version in node_modules (3.5.1)
  4. Ctrl+F > const concat:

You will see this,
image

Cannot find module 'expr-library/factory'.ts(2307)

That module, indeed, does not exist.

In fact, it is looking for import("expr-library/factory/make-operator-1-to-n").Operator1ToN but is looking at the wrong module.

There are many other places where it references "expr-library/factory", which does not exist.

Expected behavior:

emitted .d.ts should either use import("expr-library/factory/make-operator-1-to-n").Operator1ToN or emit a "expr-library/factory" module

Actual behavior:

Emit uses "expr-library/factory", it does not exist

Playground Link: None

Related Issues: None

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

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

はじめの一歩

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

調査の方向性

tsqlリポジトリをコミット e5a0d16ac31d868f03386b4381e51eed5f6c731d の状態でクローンし、依存関係をインストールして、AMD と outFile を指定して提供されている tsc コマンドを実行します。test-amd.d.ts の concat 宣言と、その expr-library/factory 参照の周辺を調査します。Declaration emit が既存の make-operator-1-to-n モジュールを参照するか、未解決の unresolved-module エラーなしで一致する expr-library/factory モジュールを出力すれば完了です。

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

評価

技術スタック
typescript
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

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

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