In this post, we will see how to resolve error TS2339: Property ‘remove’ does not exist on type ‘Document<unknown,
Question:
I’m getting this error on my applicationruntime Error :
TSError: ⨯ Unable to compile TypeScript: src/controllers/notes.ts:134:20 – error TS2339: Property ‘remove’ does not exist on type ‘Document<unknown, {}, { createdAt: NativeDate; updatedAt: NativeDate; } & { title: string; text?: string | undefined; }> & Omit<{ createdAt: NativeDate; updatedAt: NativeDate; } & { …; } & { …; }, never>’.
134 await note.remove()
highlighted Error :
any Property ‘remove’ does not exist on type ‘Document<unknown, {}, { createdAt: NativeDate; updatedAt: NativeDate; } & { title: string; text?: string | undefined; }> & Omit<{ createdAt: NativeDate; updatedAt: NativeDate; } & { …; } & { …; }, never>’.ts(2339)
Controllers/notes
Best Answer:
Guessing you are following the same tutorial.if you want to keep:
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com