-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Bluebird promise is not compatible with es6 Promise interace #78
Comments
I also met this issue before, but what you did cannot be considered a fix. You changed the file so that instead of exporting a Bluebird promise, you are just exporting a plain ES6 Promise. Which means all methods in Sequelize are now typed as returning a plain ES6 promise, and you cannot use any of the bluebird methods on it (like Can you provide me a bit more details how the error occured? What code caused this, what TS version are you using and what Sequelize version? |
Oh, I know that it's not a fix, It's just workarounds for es6 syntax. Regenerating the error message is quite easy. See below code: import { Model } from 'sequelize';
export class MyModel extends Model {
static getSomeModel(): Promise<MyModel[]> {
return this.findAll({ where: { someProperty: true } });
}
} in typescript v2.0.9, sequelize v4.0.0-1 Should we wait for bluebird typings takes es6 Promise compatable interface? |
#When I tried to make a method that wraps model methods and return with default es6 Promise interface (declared from lib.es6.d.ts), it returns incompatible type error:
So I changed promise.d.ts file like this
then the error has gone.
Consider this issue :)
The text was updated successfully, but these errors were encountered: