node-ottoman
node-ottoman copied to clipboard
Error import with TypeScript in framework Nest.js
Example Import:
import { Ottoman, set } from 'ottoman'
const ottoman = new Ottoman() ottoman.connect(config.db)
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 11 more.
8 export declare class Model<T = any, R = any> extends Document implements IModel<T, R> {
Hi @Max110011 which version of Ottoman are you using ?
Version Ottoman "2.0.0-beta.8"
Version NestJs "7.5.1"
hi @Max110011
A quick solution could be by setting in your tsconfig.json the option: "skipLibCheck": true
Greetings.
TANKS Thank you work
Hi @Max110011 can you close this if this helped ?
@gsi-alejandro why are we seeing this issue is there any other permanent fix ?
Seeing this issue as well; I'm on version 2.0.0.
Adding "skipLibCheck": true to my tsconfig.json is fine as a temporary workaround, but this issue should be looked into further.
Agreed, we will address it in this ticket
The next Ottoman release will enable typescript users to use ottoman without the skipLibCheck flag if they want to.