Skip to content
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

Type error when used with Bluebird #10

Closed
vajahath opened this issue Nov 17, 2017 · 2 comments
Closed

Type error when used with Bluebird #10

vajahath opened this issue Nov 17, 2017 · 2 comments

Comments

@vajahath
Copy link

I'm using sequelizejs

	[err, dbResponse] = await to(
		user.findOne({
			where: {
				email: req.body.email,
				passwordHash: req.body.password,
			},
		}),
	);

err:

Argument of type 'Bluebird<{}>' is not assignable to parameter of type 'Promise<{}>'.
Property '[Symbol.toStringTag]' is missing in type 'Bluebird<{}>'.

@dygufa
Copy link

dygufa commented Nov 27, 2017

I had this problem too. Currently await-to-js only supports "real Promises", but async / await accepts any function that returns an object with .then and .catch defined. This could be solved by changing the type description to accept all functions with .then and .catch defined, I guess.
@scopsy, do you agree?

@scopsy
Copy link
Owner

scopsy commented Nov 21, 2018

Should be fixed by #21 I'll upload a new version to NPM asap.
Sorry for not being so responsive.

@scopsy scopsy closed this as completed Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants