microsoft / microsoft/TypeScript
Duplicate identifier errors when using @types inside a Windows junction
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.4k
- Merge moyen
- 1 j 19 h
- PR mergées (30 j)
- 117
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez avec les fichiers index.ts et package.json fournis dans un projet Windows où e:\work est une jonction vers y:\work, puis exécutez npm install et npm run tsc. Suivez la manière dont le compilateur résout le fichier node_modules/@types/youtube/index.d.ts référencé et vérifiez que le même fichier n’est pas signalé sous les deux chemins ; c’est terminé lorsque les erreurs d’identifiant en double ne se produisent plus.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- node.js, typescript
- Domaine
- compilers, operating-systems
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100