-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Error: the promise constructor cannot be invoked directly
glmdgrielson edited this page Oct 15, 2017
·
3 revisions
Error: the promise constructor cannot be invoked directly.
You can get this error for several reasons:
This can happen when you tried to do something like:
return Promise(function(resolve,reject){
//...
})
You can correct this by doing:
return new Promise(function(resolve,reject){
//...
})
Please consider reading more about promisification and also consider checking out automatic promisification as well as Promise.method
Bluebird does not support extending promises this way. Instead, see the Guide for Library Authors.