cli icon indicating copy to clipboard operation
cli copied to clipboard

Generate app mongodb type errors

Open ysnfrk opened this issue 4 years ago • 0 comments

Steps to reproduce

  1. Create new folder
  2. Open terminal and type following commands
  3. npm install -g @feathersjs/cli
  4. feathers generate app
  5. select TypeScript
  6. enter ProjectName (Test)
  7. enter Description
  8. select src
  9. select npm
  10. select Rest and Realtime via Socket.io
  11. select Mocha + assert
  12. select Y for authentication
  13. select Username + Password (Local)
  14. select users
  15. select Mongoose
  16. select default database connection string
  17. type npm start
  18. get the type errors

Expected behavior

Project needs to start

Actual behavior

Got type errors. It is actually a problem with mongoose dependencies.

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3309:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'. Type 'void' is not assignable to type 'this'. 'this' could be instantiated with an arbitrary type which could be unrelated to 'void'.

3309 end(): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3309:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'. Type 'void' is not assignable to type 'this'. 'this' could be instantiated with an arbitrary type which could be unrelated to 'void'.

3309 end(): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3310:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.

3310 end(chunk: Buffer): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3310:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'.

3310 end(chunk: Buffer): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3311:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.

3311 end(callback: Callback<GridFSFile | void>): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3311:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'.

3311 end(callback: Callback<GridFSFile | void>): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3312:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.

3312 end(chunk: Buffer, callback: Callback<GridFSFile | void>): void;
~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3312:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'.

3312 end(chunk: Buffer, callback: Callback<GridFSFile | void>): void;
~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3313:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.

3313 end(chunk: Buffer, encoding: BufferEncoding): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3313:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'.

3313 end(chunk: Buffer, encoding: BufferEncoding): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3314:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.

3314 end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): void; ~~~

node_modules/mongoose/node_modules/mongodb/mongodb.d.ts:3314:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'WritableStream'. Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>): void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (data: string | Uint8Array, cb?: (() => void) | undefined): this; (str: string, encoding?: BufferEncoding | undefined, cb?: (() => void) | undefined): this; }'.

3314 end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): void; ~~~

Found 12 errors.

System configuration

Module versions : "dependencies": { "@feathersjs/authentication": "^4.5.12", "@feathersjs/authentication-local": "^4.5.12", "@feathersjs/authentication-oauth": "^4.5.12", "@feathersjs/configuration": "^4.5.12", "@feathersjs/errors": "^4.5.12", "@feathersjs/express": "^4.5.12", "@feathersjs/feathers": "^4.5.12", "@feathersjs/socketio": "^4.5.13", "@feathersjs/transport-commons": "^4.5.12", "compression": "^1.7.4", "cors": "^2.8.5", "feathers-mongodb": "^6.4.1", "helmet": "^4.6.0", "mongodb": "^4.3.0", "mongodb-core": "^3.2.7", "serve-favicon": "^2.5.0", "winston": "^3.4.0" }, "devDependencies": { "@types/compression": "^1.7.2", "@types/cors": "^2.8.12", "@types/jsonwebtoken": "^8.5.7", "@types/mocha": "^9.0.0", "@types/mongodb": "^4.0.7", "@types/serve-favicon": "^2.5.3", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "axios": "^0.24.0", "eslint": "^8.6.0", "mocha": "^9.1.4", "shx": "^0.3.4", "ts-node-dev": "^1.1.8", "typescript": "^4.5.4" }

NodeJS version: v16.13.2

Operating System: Windows/Ubuntu

ysnfrk avatar Jan 17 '22 12:01 ysnfrk