mongoose-paginate icon indicating copy to clipboard operation
mongoose-paginate copied to clipboard

Promise resolver undefined is not a function

Open gitawego opened this issue 7 years ago • 1 comments

the module throws error because of misuse of Promise.

Promise can not be instantiated without params.

at line 92 in index.js, instead of

let promise = new Promise();
promise.resolve(result);
return promise;

it should be

return Promise.resolve(result);

or return directly the result

gitawego avatar Sep 29 '16 15:09 gitawego

@gitawego there are many issues with the current version on npm. I've just pushed a PR #95 to fix the issues. In the meantime you can use my branch which includes these fixes:

npm install fiznool/mongoose-paginate

fiznool avatar Sep 29 '16 15:09 fiznool