Skip to content

a promise was created in a handler but was not returned from it #2363

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

Open
1 task done
lianyi opened this issue Nov 24, 2016 · 0 comments
Open
1 task done

a promise was created in a handler but was not returned from it #2363

lianyi opened this issue Nov 24, 2016 · 0 comments

Comments

@lianyi
Copy link

lianyi commented Nov 24, 2016

Error Message

(node:4764) Warning: a promise was created in a handler at myapp/server/auth/auth.service.js:38:11 but was not returned from it, see http://goo.gl/rRqMUw
    at new Promise (myapp\node_modules\bluebird\js\release\promise.js:77:14)`

And possible fix is to return it in then

User.findById(req.user._id).exec()
       .then(user => {
         if(!user) {
           return res.status(401).end();
         }
         req.user = user;
         next();
         return null; // <----- this line
       })
       .catch(err => next(err));
  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.1.10
Node v6.1.0
npm 4.0.3
Operating System Windows 10
Item Answer
Transpiler TypeScript
Markup HTML
CSS LESS
Router ui-router
Client Tests Mocha
DB MongoDB
Auth Y
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

1 participant