You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've just encountered the issue that importing (not running, but importing) passport-saml throws an error when:
Node 20.6.0 is used
you're importing passport-saml into an ESM module
Importing passport-saml will throw this error:
class MultiSamlStrategy extends strategy_1.AbstractStrategy {
^
TypeError: Class extends value undefined is not a constructor or null
at Object.<anonymous> (~/saml/node_modules/@node-saml/passport-saml/lib/multiSamlStrategy.js:6:44)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at Object.<anonymous> (~/saml/node_modules/@node-saml/passport-saml/lib/index.js:21:29)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
Node.js v20.6.0
Using an older node version works fine, and importing passport-saml into a CJS module works fine as well.
Summary
We've just encountered the issue that importing (not running, but importing) passport-saml throws an error when:
Importing passport-saml will throw this error:
Using an older node version works fine, and importing passport-saml into a CJS module works fine as well.
To Reproduce
See here for an MWE: https://github.com/LaurensRietveld/saml-mwe and follow the readme:
yarn
node ./test.cjs
. This works finenode ./test.js
. This throw the error aboveProbable cause
I expect this be caused by circular reference issue (given that this results in undefined imports). I noticed two circular references:
MultiSamlStrategy.js
depends on onindex.js
, which depends onMultiSamlStrategy.js
MultiSamlStrategy.js
depends onstrategy.js
, which depends onindex.js
which depends onMultiSamlStrategy.js
Environment
passport-saml
version: 4.0.4The text was updated successfully, but these errors were encountered: