Skip to content

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

Open
@lianyi

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions