Skip to content
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

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

Open
dottodot opened this issue Feb 11, 2016 · 6 comments
Open

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

dottodot opened this issue Feb 11, 2016 · 6 comments

Comments

@dottodot
Copy link

On sails 0.12.0 I'm getting the warning

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

which I believe is due to the policies Promises needing a return. Here's the issues I orginally posted on sails balderdashy/sails#3556

@khchan
Copy link
Contributor

khchan commented Feb 19, 2016

+1 I'm getting the same warnings in my controllers.

@wfpaisa
Copy link

wfpaisa commented Mar 16, 2016

Warning: a promise was created in a handler but was not returned from it
    at wrapper (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/lodash/index.js:3592:19)
    at applyInOriginalCtx (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:417:80)
    at wrappedCallback (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:320:18)
    at callback.success (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
    at _switch (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:58:28)
    at /Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/dql/update.js:234:9
    at /Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:52:16
From previous event:
    at Deferred.toPromise (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/deferred.js:494:61)
    at Deferred.then (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/query/deferred.js:505:15)
    at attachDefaultRole (/Users/pepito/Sites/sailsjs/permissions2/node_modules/sails-permissions/dist/api/models/User.js:33:45)
    at fn (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/callbacksRunner.js:60:10)
    at /Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:181:20
    at iterate (/Users/pepito/.nvm/versions/node/v4.4.0/lib/node_modules/sails/node_modules/waterline/node_modules/async/lib/async.js:262:13)

@quantjin
Copy link

I'm also getting this warning with sails 0.12.1

@lakinoheat
Copy link

Is this issue still not fixed? Am also having this same warning.

@giano
Copy link

giano commented Jun 14, 2016

Same on Sails 0.12.3

@medisoft
Copy link

medisoft commented Apr 6, 2017

Same as me

Warning: a promise was created in a handler but was not returned from it
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at Deferred.toPromise (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/waterline/lib/waterline/query/deferred.js:494:61)
    at Deferred.then (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/waterline/lib/waterline/query/deferred.js:505:15)
    at Object.module.exports.load (/home/mario/IdeaProjects/IG/scorecard/backend/api/controllers/TestItemController.js:18:8)
    at wrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/lodash/lib/index.js:3250:19)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/CriteriaPolicy.js:53:12)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/RolePolicy.js:26:12)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at /home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/PermissionPolicy.js:43:5
From previous event:
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/PermissionPolicy.js:34:51)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at OwnerPolicy (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/OwnerPolicy.js:33:3)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/AuditPolicy.js:22:3)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at ModelPolicy (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-permissions/dist/api/policies/ModelPolicy.js:28:12)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
From previous event:
    at Deferred.then (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/waterline/lib/waterline/query/deferred.js:505:27)
    at /home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/dist/api/services/passport.js:327:40
    at pass (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/authenticator.js:347:9)
    at Authenticator.deserializeUser (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/authenticator.js:352:5)
    at SessionStrategy.authenticate (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/strategies/session.js:53:28)
    at attempt (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/middleware/authenticate.js:348:16)
    at authenticate (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/middleware/authenticate.js:349:7)
    at /home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/dist/api/policies/passport.js:37:23
    at initialize (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/node_modules/passport/lib/middleware/initialize.js:53:5)
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/dist/api/policies/passport.js:35:24)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at module.exports (/home/mario/IdeaProjects/IG/scorecard/backend/node_modules/sails-auth/dist/api/policies/basicAuth.js:13:12)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:135:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:167:11)
    at module.exports (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/hooks/cors/clear-headers.js:14:3)
    at routeTargetFnWrapper (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/lib/router/bind.js:181:5)
    at callbacks (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:164:37)
    at param (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:138:11)
    at pass (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:145:5)
    at nextRoute (/home/mario/.nvm/versions/node/v5.8.0/lib/node_modules/sails/node_modules/@sailshq/express/lib/router/index.js:100:7)

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

7 participants