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

sails-auth module gives “Cannot read property 'loadStrategies' of undefined” on update #114

Open
drj-io opened this issue Nov 26, 2015 · 5 comments

Comments

@drj-io
Copy link

drj-io commented Nov 26, 2015

This is from a repository that I originally started in sails .11.0.0. Later cloning my app repo and doing npm install breaks my app.

$ sails lift

info: Starting app...

/home/david/x/webapp/node_modules/sails-auth/api/hooks/sails-auth.js:4
sails.services.passport.loadStrategies();
^
TypeError: Cannot call method 'loadStrategies' of undefined
at Hook.initialize (/home/david/x/webapp/node_modules/sails-auth/api/hooks/sails-auth.js:4:31)
at Hook.bound as initialize
at /home/david/x/webapp/node_modules/sails/lib/hooks/index.js:75:14
at /home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:451:17
at /home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:441:17
at _each (/home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:46:13)
at Object.taskComplete (/home/david/x/webapp/node_modules/sails/node_modules/async/lib/async.js:440:13)
at processImmediate as _immediateCallback
This was working fine with sails-auth 1.0.10 but broke with sails-auth 1.2.3 .

Would love to be current. I answered this SO issue here too: http://stackoverflow.com/questions/32792853/sails-auth-module-gives-cannot-read-property-loadstrategies-of-undefined

@klaoha06
Copy link

klaoha06 commented Dec 1, 2015

+1

@klaoha06
Copy link

klaoha06 commented Dec 1, 2015

duplicate issue

@befreestudios
Copy link

+1 Having same issue.

@YoleYu
Copy link

YoleYu commented Jan 6, 2016

+1
I'm new to sailsJS, do not know why this happened.
Reproduce Step:

  1. sails new sails-auth-test
  2. cd sails-auth-test/
  3. $ npm install sails-auth --save
    [email protected] node_modules\sails-auth
    ├── [email protected] ([email protected], [email protected])
    ├── [email protected] ([email protected])
    └── [email protected] ([email protected], [email protected])
  4. $ sails lift

info: Starting app...

C:\yole\code\sails-auth-test\node_modules\sails-auth\api\hooks\sails-auth.js:4
sails.services.passport.loadStrategies();
^

TypeError: Cannot read property 'loadStrategies' of undefined
at Hook.initialize (C:\yole\code\sails-auth-test\node_modules\sails-auth\api\hooks\sails-auth.js:4:30)
at Hook.bound as initialize
at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\lib\hooks\index.js:74:14
at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:451:17
at C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:441:17
at _each (C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:46:13)
at Immediate.taskComplete (C:\Users\yinglli\AppData\Roaming\npm\node_modules\sails\node_modules\async\lib\async.js:440:13)
at processImmediate as _immediateCallback

@YoleYu
Copy link

YoleYu commented Jan 6, 2016

resolved by specify version to 2.1.1 in package.json

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

4 participants