DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

Nodejs express typescript complier error. @types/mongoose:^5.10.2

Open
#50,104 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

declare module "mongoose" {


node_modules/mongoose/index.d.ts:1:1
 1 declare module "mongoose" {
   ~~~~~~~
 Conflicts are in this file.

node_modules/@types/mongoose/index.d.ts:227:14 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'SchemaTypes' must be of type 'typeof Types', but here has type 'typeof Types'.

227   export var SchemaTypes: typeof Schema.Types;
              ~~~~~~~~~~~

node_modules/mongoose/index.d.ts:59:14
 59   export var SchemaTypes: typeof Schema.Types;
                 ~~~~~~~~~~~
 'SchemaTypes' was also declared here.

node_modules/@types/mongoose/index.d.ts:823:24 - error TS2314: Generic type 'Query<ResultType, DocType, T>' requires 3 type argument(s).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the compiler errors involving node_modules/mongoose/index.d.ts and node_modules/@types/mongoose/index.d.ts, using the versions indicated in the title. Compare the conflicting SchemaTypes declarations and Query generic arguments, then verify that the reported TypeScript errors are resolved without introducing new declaration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, nodejs, typescript
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.