passport-saml: [BUG] Cannot read property 'Strategy' of undefined

After updating to 1.4.0 (also tried 1.4.1 and 1.4.2) I get the following runtime error:

/workspaces/UWER/dist/backend/index.js:93
  _passport.default.use(new _passportSaml.default.Strategy({
                                                  ^

TypeError: Cannot read property 'Strategy' of undefined
    at Object.<anonymous> (/workspaces/UWER/dist/backend/index.js:93:51)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47

You can view the code here.

Environment

  • Node.js version: 14.13.1
  • passport-saml version: 1.4.0, 1.4.1, 1.4.2

I don’t usually develop in JS so my apologies in advance if this is my mistake.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (8 by maintainers)

Commits related to this issue

Most upvoted comments

on version 1.5.0 getting: TypeError: parser.parseStringPromise is not a function at SAML.processValidlySignedAssertion (/app/server/node_modules/passport-saml/src/passport-saml/saml.ts:970:12) at /app/server/node_modules/passport-saml/src/passport-saml/saml.ts:708:21 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5)

@guru Thank you, that seemed to work. If adding export default helps not break others that use Babel it may be a good idea.

This solved my runtime issue, but I have another issue that is happening on login.

TypeError: parser.parseStringPromise is not a function
    at SAML.processValidlySignedAssertion (/www/node_modules/passport-saml/lib/passport-saml/saml.js:233:20)
    at /www/node_modules/passport-saml/lib/passport-saml/saml.js:769:29
    at _fulfilled (/www/node_modules/q/q.js:854:54)
    at /www/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/www/node_modules/q/q.js:816:13)
    at /www/node_modules/q/q.js:624:44
    at runSingle (/www/node_modules/q/q.js:137:13)
    at flush (/www/node_modules/q/q.js:125:13)
    at processTicksAndRejections (internal/process/task_queues.js:75:11)