microsoft / microsoft/TypeScript

d.ts type imports are not resolved correctly in dependencies

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

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

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

説明

TypeScript Version: 4.1.0-dev.20200915

Search Terms:

path module resolution

Code

Please check this repo: https://github.com/dkjii-g/tsc-ref-bug

Check the README for bugs/instructions.

Expected behavior:

  • The 4 folders compile correctly (they are slight variations to better explain the bug - you don't have to check them all).
  • Typescript should not use the current project's module resolution when importing a different project's definitions.

Actual behavior:

Typescript tries to import repo2's modules from repo1's project.

This prevents the compiler from finding the type definition in dependencies.

Related Issues: #38111 #39117 (not sure)

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

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

はじめの一歩

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

調査の方向性

リンクされた tsc-ref-bug リポジトリの README から始め、4 つのフォルダーのバリエーションを実行します。その際、repo2 からの import が repo1 から解決されるケースに注目してください。コンパイラーの期待される動作と実際の動作を比較し、その後、依存関係の定義が現在のプロジェクトではなく依存プロジェクトのモジュール解決を使用して解決されることを確認してください。

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

評価

技術スタック
typescript
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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