Property 'catch' does not exist on type 'Promise<void>' Property 'catch' does not exist on type 'Promise<void>' mongoose mongoose

Property 'catch' does not exist on type 'Promise<void>'


According to DefinitelyTyped's mongoose.d.ts

/** * To assign your own promise library: * * 1. Include this somewhere in your code: *    mongoose.Promise = YOUR_PROMISE; * * 2. Include this somewhere in your main .d.ts file: *    type MongoosePromise<T> = YOUR_PROMISE<T>; */

So, your main .d.ts file would look like the following:

/// <reference path="globals/bluebird/index.d.ts" />/// <reference path="globals/mongoose/index.d.ts" />type MongoosePromise<T> = bluebird.Promise<T>;


I've ended up doing this extending the mongoose module:

declare module "mongoose" {    import Bluebird = require("bluebird");    type MongoosePromise<T> = Bluebird<T>;}

See my answer here : Mongoose Promise with bluebird and typescript