question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate identifier errors when using @types inside a Windows junction

See original GitHub issue

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 Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Bosch-Eli-Blackcommented, Mar 24, 2022

@minestarks Upgrading to VS 17.2 Preview 2 fixed our issue 🙂 Thanks again for your help!

1reaction
minestarkscommented, Mar 7, 2022

Got it. I’m able to repro with @Spongman 's repro steps. There does seem to be a bug as to how we handle junctions.

@Bosch-Eli-Black I think your repro is the victim of multiple different bugs - one, as I mentioned, is fixed in the next update the VS. The second one, where we included a lot of unnecessary typings (which caused all the unnecessary errors) was fixed in #47164 , which is in TS 4.6, which is also bundled in the next update to VS. With these two fixed, I think you won’t even hit the third one, which is this bug 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Confusing "duplicate identifier" Typescript error message
If you are using Typings and exclude in your tsconfig.json, you may run into the issue of duplicate types and need something like...
Read more >
Managing ambient type definitions and dealing with the ...
The ambient type definitions are not namespaced, they are always global! Fix Duplicate * error in TypeScript by using tsconfig. json 's exclude...
Read more >
Attribute Assistant | ArcGIS Solutions
Attribute Assistant can be used to automatically populate attribute values using predefined methods when creating or editing geodatabase features with ArcMap.
Read more >
Compatibility Fixes for Windows 10, Windows 8, Windows 7 ...
This fix repairs applications that use GDI and that work in 8-bit color mode. The application is forced to repaint its window on...
Read more >
os — Miscellaneous operating system interfaces — Python ...
In Python, file names, command line arguments, and environment variables are ... See also the UTF-8 mode on Windows and the filesystem encoding...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found