microsoft / microsoft/TypeScript
Duplicate identifier errors when using @types inside a Windows junction
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
This is a dupe of #11333, but that issue was marked as closed/fixed (and locked... why?). It's not. It should be reopened and actually fixed. It's also unrelated to 'npm link'.
IMPORTANT:
my e:\work directory is a JUNCTION point to y:\work
node: 13.5.0
npm: 6.13.4
tsc: 3.7.5
index.ts:
/// <reference path="node_modules/@types/youtube/index.d.ts" />
package.json:
{
"name": "junction-bug",
"scripts": {
"tsc": "tsc index.ts"
},
"devDependencies": {
"@types/youtube": "0.0.38",
"typescript": "^3.7.5"
}
}
NOTE: There is NO reference to 'y:' in any of my project's files, nor in any of npm's files. tsc is erroneously converting relative paths to absolute paths on the destination drive. look for references to y:\ in the output below:
e:\work\junction-bug>dir e:\ | findstr work
04/19/2016 09:02 AM <JUNCTION> work [y:\work]
e:\work\junction-bug>npm i
...
e:\work\junction-bug>findstr /s /i /c:"y:\\" *
e:\work\junction-bug>npm run tsc
> junction-bug@ tsc E:\work\junction-bug
> tsc index.ts
node_modules/@types/youtube/index.d.ts:16:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: UNSTARTED, ENDED, PLAYING, PAUSED, BUFFERING, CUED, InvalidParam, Html5Error, VideoNotFound, EmbeddingNotAllowed, EmbeddingNotAllowed2, AlwaysVisible, HideAllControls, HideProgressBar, NoAutoPlay, AutoPlay, UserDefault, ForceOn, ProgressBarColor, Hide, ShowLoadPlayer, ShowDelayLoadPlayer, Enable, Disable, Show, ListType, ListTypePlayer, ListTypeSearch, ListTypeUserUploads, SinglePlay, Loop, Full, Modest, Fullscreen, Inline, SuggestedVideoQuality, VideoQualityDefault, VideoQualitySmall, VideoQualityMedium, VideoQualityLarge, VideoQualityHD720, VideoQualityHD1080, VideoQualityHighRes, Player
16 declare namespace YT
~~~~~~~
y:/work/junction-bug/node_modules/@types/youtube/index.d.ts:16:1
16 declare namespace YT
~~~~~~~
Conflicts are in this file.
y:/work/junction-bug/node_modules/@types/youtube/index.d.ts:16:1 - error TS6200: Definitions of the following identifiers conflict with those in
another file: UNSTARTED, ENDED, PLAYING, PAUSED, BUFFERING, CUED, InvalidParam, Html5Error, VideoNotFound, EmbeddingNotAllowed, EmbeddingNotAllowed2, AlwaysVisible, HideAllControls, HideProgressBar, NoAutoPlay, AutoPlay, UserDefault, ForceOn, ProgressBarColor, Hide, ShowLoadPlayer, ShowDelayLoadPlayer, Enable, Disable, Show, ListType, ListTypePlayer, ListTypeSearch, ListTypeUserUploads, SinglePlay, Loop, Full, Modest, Fullscreen, Inline, SuggestedVideoQuality, VideoQualityDefault, VideoQualitySmall, VideoQualityMedium, VideoQualityLarge, VideoQualityHD720, VideoQualityHD1080, VideoQualityHighRes, Player
16 declare namespace YT
~~~~~~~
node_modules/@types/youtube/index.d.ts:16:1
16 declare namespace YT
~~~~~~~
Conflicts are in this file.
Found 2 errors.
Related Issues: 113333
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
提供された index.ts と package.json を使い、e:\work が y:\work への junction である Windows プロジェクトから始めて、npm install と npm run tsc を実行します。コンパイラーが参照されている node_modules/@types/youtube/index.d.ts をどのように解決するかを追跡し、同じファイルが両方のパスで報告されないことを確認します。完了条件は、重複識別子エラーが発生しなくなることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- node.js, typescript
- 領域
- compilers, operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100