microsoft / microsoft/TypeScript
Duplicate identifier errors when using @types inside a Windows junction
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con i file index.ts e package.json forniti in un progetto Windows in cui e:\work è una junction verso y:\work, quindi esegui npm install e npm run tsc. Traccia il modo in cui il compilatore risolve il file node_modules/@types/youtube/index.d.ts referenziato e verifica che lo stesso file non venga segnalato tramite entrambi i percorsi; l'operazione è completata quando gli errori di identificatore duplicato non si verificano più.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- node.js, typescript
- Ambito
- compilers, operating-systems
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100