-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Error: Cannot promisify an API that has normal methods
benjamingr edited this page Dec 21, 2014
·
2 revisions
Error: Cannot promisify an API that has normal methods
This error indicates you have tried to call Promise.promisifyAll
on an object that already has a property with the Async
suffix:
var myApi = { foo: function(cb){ ... }, fooAsync(cb) { ... }
This is because Bluebird adds the Async
suffix to distinguish the original method from the promisified one, so fooAsync
would have been overridden. In order to avoid this - either rename fooAsync
before promisifying the API, or call Promise.promisify
manually on select properties.
If you find this issue in a common library please open an issue