Issue 1:
I tried using the @types/connect-mongo package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @simonxca, @horiuchi, @sindrenm, @lukasz-zak

Hi

I got this error no another project, so I created a minimal project with connect-mongo, and I'm still getting this error. Here's the project. Basically all I did is install @types/connect-mongo, @types/cookie-parser, @types/mongoose (without even the actual implementation of those packages) and ran tsc -p tsconfig.json and I got the following output:

node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(87,9): error TS2300: Duplicate identifier 'NativeBuffer'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(88,9): error TS2300: Duplicate identifier 'NativeDate'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(89,9): error TS2300: Duplicate identifier 'NativeError'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(97,14): error TS2300: Duplicate identifier 'Mongoose'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(98,8): error TS2300: Duplicate identifier 'Mongoose'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(196,9): error TS2300: Duplicate identifier 'CastError'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(260,18): error TS2300: Duplicate identifier 'ConnectionBase'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(479,9): error TS2300: Duplicate identifier 'Connection'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(495,9): error TS2300: Duplicate identifier 'ValidationError'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(504,9): error TS2300: Duplicate identifier 'Error'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(594,9): error TS2300: Duplicate identifier 'VirtualType'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(611,9): error TS2300: Duplicate identifier 'Schema'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(701,48): error TS2314: Generic type 'HookAsyncCallback<T>' requires 1 type argument(s).
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(702,29): error TS2314: Generic type 'HookSyncCallback<T>' requires 1 type argument(s).
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(764,13): error TS2428: All declarations of 'HookSyncCallback' must have identical type parameters.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(768,13): error TS2428: All declarations of 'HookAsyncCallback' must have identical type parameters.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1015,13): error TS2300: Duplicate identifier 'MongooseDocument'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1016,9): error TS2300: Duplicate identifier 'MongooseDocument'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1222,11): error TS2300: Duplicate identifier 'Subdocument'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1238,11): error TS2300: Duplicate identifier 'Array'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1347,11): error TS2300: Duplicate identifier 'DocumentArray'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1376,11): error TS2300: Duplicate identifier 'Buffer'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1408,10): error TS2300: Duplicate identifier 'ObjectIdConstructor'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1416,11): error TS2300: Duplicate identifier 'Decimal128'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1422,11): error TS2300: Duplicate identifier 'Embedded'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1462,9): error TS2300: Duplicate identifier 'Query'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1463,9): error TS2300: Duplicate identifier 'DocumentQuery'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1889,9): error TS2300: Duplicate identifier 'mquery'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(1941,13): error TS2300: Duplicate identifier 'Schema'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(2189,9): error TS2300: Duplicate identifier 'Aggregate'.
node_modules/@types/connect-mongo/node_modules/@types/mongoose/index.d.ts(2324,9): error TS2300: Duplicate identifier 'SchemaType'.
node_modules/@types/mongoose/index.d.ts(61,9): error TS2300: Duplicate identifier 'NativeBuffer'.
node_modules/@types/mongoose/index.d.ts(62,9): error TS2300: Duplicate identifier 'NativeDate'.
node_modules/@types/mongoose/index.d.ts(63,9): error TS2300: Duplicate identifier 'NativeError'.
node_modules/@types/mongoose/index.d.ts(71,14): error TS2300: Duplicate identifier 'Mongoose'.
node_modules/@types/mongoose/index.d.ts(72,8): error TS2300: Duplicate identifier 'Mongoose'.
node_modules/@types/mongoose/index.d.ts(156,9): error TS2300: Duplicate identifier 'CastError'.
node_modules/@types/mongoose/index.d.ts(177,18): error TS2300: Duplicate identifier 'ConnectionBase'.
node_modules/@types/mongoose/index.d.ts(447,9): error TS2300: Duplicate identifier 'Connection'.
node_modules/@types/mongoose/index.d.ts(463,9): error TS2300: Duplicate identifier 'ValidationError'.
node_modules/@types/mongoose/index.d.ts(472,9): error TS2300: Duplicate identifier 'Error'.
node_modules/@types/mongoose/index.d.ts(562,9): error TS2300: Duplicate identifier 'VirtualType'.
node_modules/@types/mongoose/index.d.ts(579,9): error TS2300: Duplicate identifier 'Schema'.
node_modules/@types/mongoose/index.d.ts(801,13): error TS2428: All declarations of 'HookSyncCallback' must have identical type parameters.
node_modules/@types/mongoose/index.d.ts(805,13): error TS2428: All declarations of 'HookAsyncCallback' must have identical type parameters.
node_modules/@types/mongoose/index.d.ts(850,5): error TS2717: Subsequent property declarations must have the same type. Property 'strict' must be of type 'boolean', but here has type 'boolean | "throw"'.
node_modules/@types/mongoose/index.d.ts(852,5): error TS2717: Subsequent property declarations must have the same type. Property 'toJSON' must be of type 'any', but here has type 'DocumentToObjectOptions'.
node_modules/@types/mongoose/index.d.ts(854,5): error TS2717: Subsequent property declarations must have the same type. Property 'toObject' must be of type 'any', but here has type 'DocumentToObjectOptions'.
node_modules/@types/mongoose/index.d.ts(876,5): error TS2717: Subsequent property declarations must have the same type. Property 'timestamps' must be of type 'any', but here has type 'boolean | SchemaTimestampsConfig'.
node_modules/@types/mongoose/index.d.ts(888,5): error TS2374: Duplicate string index signature.
node_modules/@types/mongoose/index.d.ts(968,5): error TS2717: Subsequent property declarations must have the same type. Property 'validate' must be of type 'any', but here has type 'RegExp | [RegExp, string] | ValidateFn<T> | [ValidateFn<T>, string] | ValidateOpts | ValidateOpts...'.
node_modules/@types/mongoose/index.d.ts(1018,5): error TS2374: Duplicate string index signature.
node_modules/@types/mongoose/index.d.ts(1046,7): error TS2717: Subsequent property declarations must have the same type. Property 'validator' must be of type 'Function | RegExp', but here has type 'RegExp | ValidateFn<any>'.
node_modules/@types/mongoose/index.d.ts(1072,13): error TS2300: Duplicate identifier 'MongooseDocument'.
node_modules/@types/mongoose/index.d.ts(1073,9): error TS2300: Duplicate identifier 'MongooseDocument'.
node_modules/@types/mongoose/index.d.ts(1275,11): error TS2300: Duplicate identifier 'Subdocument'.
node_modules/@types/mongoose/index.d.ts(1291,11): error TS2300: Duplicate identifier 'Array'.
node_modules/@types/mongoose/index.d.ts(1400,11): error TS2300: Duplicate identifier 'DocumentArray'.
node_modules/@types/mongoose/index.d.ts(1429,11): error TS2300: Duplicate identifier 'Buffer'.
node_modules/@types/mongoose/index.d.ts(1461,10): error TS2300: Duplicate identifier 'ObjectIdConstructor'.
node_modules/@types/mongoose/index.d.ts(1469,11): error TS2300: Duplicate identifier 'Decimal128'.
node_modules/@types/mongoose/index.d.ts(1475,11): error TS2300: Duplicate identifier 'Embedded'.
node_modules/@types/mongoose/index.d.ts(1515,9): error TS2300: Duplicate identifier 'Query'.
node_modules/@types/mongoose/index.d.ts(1516,9): error TS2300: Duplicate identifier 'DocumentQuery'.
node_modules/@types/mongoose/index.d.ts(1948,9): error TS2300: Duplicate identifier 'mquery'.
node_modules/@types/mongoose/index.d.ts(2000,13): error TS2300: Duplicate identifier 'Schema'.
node_modules/@types/mongoose/index.d.ts(2248,9): error TS2300: Duplicate identifier 'Aggregate'.
node_modules/@types/mongoose/index.d.ts(2411,9): error TS2300: Duplicate identifier 'SchemaType'.
node_modules/@types/mongoose/index.d.ts(2528,29): error TS2694: Namespace '"/run/media/es/hdd/Users/User/Documents/Sem-B-2018/Node.js/test/node_modules/@types/mongodb/index"' has no exported member 'ChangeStreamOptions'.
node_modules/@types/mongoose/index.d.ts(2528,77): error TS2694: Namespace '"/run/media/es/hdd/Users/User/Documents/Sem-B-2018/Node.js/test/node_modules/@types/mongodb/index"' has no exported member 'ChangeStream'.
node_modules/@types/mongoose/index.d.ts(2864,5): error TS2374: Duplicate string index signature.
node_modules/@types/mongoose/index.d.ts(2966,5): error TS2374: Duplicate string index signature.

I noticed also that on the package.json file the dependency says

"dependencies": {
"@types/express": "*",
"@types/express-session": "*",
"@types/mongodb": "^2",
"@types/mongoose": "^4"
}

Considering that I have the latest mongoose - 5.0.18 (mongodb is already at 3 too, but I'm not using it), this seems to be the core of the problem.

So I've deleted the directory ./node_modules/@types/mongodb , installed @types/mongodb and deleted ./node_modules/@types/connect-mongo/node_modules - and it solved the problem.

But when I look at the original connect-mongo package.json file, it does list mongodb V2 as dependency and mongoose 4 as dev-dependency (though it works well with the latest versions of those packages on my original project) so I'm not sure whether I should update the @types/connect-mongo package or not.

Issue 2:
@tkrotoff, @huy-nguyen, @p-jackson VS Code complains about duplicate NavLink exported from @types/react-router-dom/index.ts (version 4.2.6):

...
45: export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> { ... }
50: export class NavLink extends React.Component<LinkProps, any> {}

52: export interface NavLinkProps extends LinkProps { ... }
60: export class NavLink extends React.Component<NavLinkProps, any> {}

I guess the fix would the patch below but I am not sure:

@50
- export class NavLink extends React.Component<LinkProps, any> {}
+ export class Link extends React.Component<LinkProps, any> {}

After applying the patch, VS Code's Intellisense is able to propose meaningful completions on <Link>. Without, it doesn't show anything useful.