node-saml / passport-saml

SAML 2.0 authentication with Passport
MIT License
862 stars 473 forks source link

Importing passport-saml fails on node v20.6.0 #879

Closed LaurensRietveld closed 7 months ago

LaurensRietveld commented 1 year ago

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:

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.

To Reproduce

See here for an MWE: https://github.com/LaurensRietveld/saml-mwe and follow the readme:

Probable cause

I expect this be caused by circular reference issue (given that this results in undefined imports). I noticed two circular references:

Environment

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 90 days with no activity.

LaurensRietveld commented 10 months ago

this is still an issue (and PR still fixes this issue)

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 90 days with no activity.