Casl: @casl/mongoose: TS2430: Interface 'AccessibleSchema' incorrectly extends interface 'Schema'.

Created on 19 Aug 2018  路  8Comments  路  Source: stalniy/casl

error

node_modules/@casl/mongoose/index.d.ts:21:18 - error TS2430: Interface 'AccessibleSchema' incorrectly extends interface 'Schema'.
  Types of property 'plugin' are incompatible.
    Type '(plugin: (schema: Schema) => void) => this' is not assignable to type '{ (plugin: (schema: Schema) => void): this; <T>(plugin: (schema: Schema, options: T) => void, opts: T): this; }'.
      Types of parameters 'plugin' and 'plugin' are incompatible.

21 export interface AccessibleSchema extends mongoose.Schema {

deps

    "@casl/mongoose": "^2.1.2",
    "typescript": "^3.0.1"
bug casmongoose help wanted

All 8 comments

Thanks for the issue! I'll check this tomorrow

it looks like you are using the latest version of mongoose. And current types support only v4 version

This issue is blocking my nestjs project from building using the given script: npm run start:prod (as the tsc stops compiling because of the error thrown). I'm trying to look for a solution, but my knowledge only goes as far.

As this is a third party lib, this is unfortunately holding me back at the moment.

Trying to look for a workaround and/or proper solution, but any help from whoever is appreciated 馃槂

I will try to solve the issue this weekend

PR added @stalniy, would highly appreciate a merge and publish of the package if it's ok. (as it's still blocking me atm).

I鈥檒l publish a package today a bit later. PR is merged

released in @casl/mongoose-v2.2.2

thanks for the support! :)

Was this page helpful?
0 / 5 - 0 ratings