microsoft / microsoft/TypeScript

Duplicate identifier errors when using @types inside a Windows junction

Offen
#36,294 12 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bug Domain: Module Resolution
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der bereitgestellten index.ts und package.json in einem Windows-Projekt, in dem e:\work eine Junction zu y:\work ist, und führen Sie anschließend npm install und npm run tsc aus. Verfolgen Sie, wie der Compiler die referenzierte node_modules/@types/youtube/index.d.ts auflöst, und überprüfen Sie, dass dieselbe Datei nicht unter beiden Pfaden gemeldet wird; abgeschlossen ist es, wenn die Fehler wegen doppelter Bezeichner nicht mehr auftreten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, typescript
Bereich
compilers, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.