3

I use promises with Mongoose, which usually throws up a deprecation warning for the internal mpromise library Mongoose uses.

The workaround given in most places is to replace Mongoose's promise library with native Promises, like this

mongoose.Promise = global.Promise

However since converting my project to TypeScript my IDE (VS Code) now throws an error saying

message: 'Type 'Function' is not assignable to type 'typeof Promise'.
  Property 'fulfilled' is missing in type 'Function'.'

enter image description here

How could I fix this?

Community
  • 1
  • 1
Aron
  • 8,696
  • 6
  • 33
  • 59

0 Answers0