Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type 'MongoClient' is missing the following properties from type 'MongoClient': logger, getLogger #493

Open
nileshtrivedi opened this issue Jun 24, 2023 · 0 comments

Comments

@nileshtrivedi
Copy link

Running npm install and npm start on Mac M1 pro throws this type error related to MongoClient

eshnil in ~/code/textbooks on branch master > node -v
v20.3.0
eshnil in ~/code/textbooks on branch master > npm -v
9.6.7

/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
node_modules/@mathigon/studio/server/utilities/mongodb.ts:40:29 - error TS2322: Type 'Promise<import("/Users/eshnil/code/textbooks/node_modules/mongoose/node_modules/mongodb/mongodb").MongoClient>' is not assignable to type 'Promise<import("/Users/eshnil/code/textbooks/node_modules/mongodb/mongodb").MongoClient>'.
  Type 'MongoClient' is missing the following properties from type 'MongoClient': logger, getLogger

40   return MongoStore.create({clientPromise, touchAfter: 12 * 3600});
                               ~~~~~~~~~~~~~

  node_modules/connect-mongo/build/main/lib/MongoStore.d.ts:14:5
    14     clientPromise?: Promise<MongoClient>;
           ~~~~~~~~~~~~~
    The expected type comes from property 'clientPromise' which is declared here on type 'ConnectMongoOptions'

    at createTSError (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/eshnil/code/textbooks/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1137:19) {
  diagnosticCodes: [ 2322 ]
}
ERROR: "server" exited with 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant