node-ottoman
node-ottoman copied to clipboard
Class 'Model<T, R>' incorrectly implements interface 'IModel<T, R>'
Hello,
I'm currently using Ottoman for my Couchbase server SDK,
But when I'm trying to build with tsc, I got the following error :
node_modules/ottoman/lib/types/model/model.d.ts:8:22 - error TS2420: Class 'Model<T, R>' incorrectly implements interface 'IModel<T, R>'.
Type 'Model<T, R>' is missing the following properties from type 'IModel<T, R>': find, count, findById, findOne, and 13 more.
8 export declare class Model<T = any, R = any> extends Document implements IModel<T, R> {
Node version : v16.13.2 Npm version : 8.5.5 Ottoman version : 2.2.0
TSConfig file :
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noImplicitReturns": true,
"noImplicitAny": false,
"noUnusedLocals": true,
"resolveJsonModule": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017",
"types": ["node", "puppeteer"]
},
"compileOnSave": true,
"include": ["src"]
}
Thanks for your help
hi @Synthx
In order to solve it as quick as possible check the suggestions below:
you can use:
tsc --skipLibCheck
or update TSConfig with:
skipLibCheck: true
@Synthx What typescript version are you using?
Greetings.
Hi, my typescript version is ^4.4.4
Thank you @Synthx.
I will check this typescript version. (Ottoman was built with 4.3.5)
for this reason, I suggest the 2 solutions above.
@Synthx the problem was solved by using skipLibCheck option?
Sorry, for not responded, still the same issue by downgrading my typescript version to 4.3.5
when i use skipLibCheck option I got a TypeError:
return series_1.SeriesModel.find({ _active: true }, { select: 'slug' });
^
TypeError: Cannot read properties of undefined (reading 'find')
Hi @Synthx
Do you have the code in a public repor or can share a little script reproducing it, to can check and correct this.
Or any other clue to help us to reproduce this issue?
I'm having the same problem and I guess this issue is a duplicate of #604.
Duplicated: please check https://github.com/couchbaselabs/node-ottoman/issues/604.
Is this resolved? I am also unable to install ottoman NPM 8.5.5 Node: 17.8.0
@gsi-alejandro assuming this is resolved ?
I just ran into this as well.
Edit: Here is a test repo. https://github.com/busheezy/node-ottoman-type-error/blob/main/tsconfig.json#L8-L9
If you try to use module: commonjs or moduleResolution: node, it dies.
Duplicated: please check https://github.com/couchbaselabs/node-ottoman/issues/604.