AxaFrance / oidc-client

Light, Secure, Pure Javascript OIDC (Open ID Connect) Client. We provide also a REACT wrapper (compatible NextJS, etc.).
MIT License
582 stars 158 forks source link

Unhandled Rejection (TypeError): userManager is undefined #403

Closed chinaq closed 3 years ago

chinaq commented 4 years ago

Issue and Steps to Reproduce

If "react-scripts" > 3.2.0, it occurs some errors by running react-scripts start

Versions

"@axa-fr/react-oidc-redux": "^3.0.8",

Screenshots

http://localhost:3000/protected1

Screen Shot 2020-02-26 at 15 37 35

Expected

No Error

Actual

TypeError

Additional Details

"dependencies": { "@axa-fr/react-oidc-redux": "^3.0.8", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.4.1", "@testing-library/user-event": "^7.2.1", "oidc-client": "1.8.2", "react": "^16.12.0", "react-app-rewired": "^2.1.5", "react-dom": "^16.12.0", "react-redux": "^5.1.1", "react-router": "^5.1.2", "react-router-dom": "^5.1.2", "recompose": "^0.30.0", "redux": "^4.0.5", "redux-oidc": "^3.1.7" }, "devDependencies": { "react-scripts": "3.4.0" },

ludojmj commented 4 years ago

Same issue as #390 react-oidc-client 3.0.6 -> UserManager undefined

daymansiege commented 4 years ago

Hi All! Can reproduce the same thing in 3.1.4

"dependencies": {
    "@axa-fr/react-oidc-redux": "^3.1.4",
    "bootstrap": "^4.3.1",
    "connected-react-router": "6.5.2",
    "env-cmd": "^10.1.0",
    "history": "4.10.1",
    "jquery": "^3.4.1",
    "merge": "1.2.1",
    "oidc-client": "^1.10.1",
    "popper.js": "^1.16.0",
    "react": "16.11.0",
    "react-dom": "16.11.0",
    "react-redux": "7.1.1",
    "react-router": "5.1.2",
    "react-router-dom": "5.1.2",
    "react-scripts": "^3.4.1",
    "reactstrap": "8.1.1",
    "recompose": "^0.30.0",
    "redux": "4.0.4",
    "redux-logger": "^3.0.6",
    "redux-oidc": "^3.1.7",
    "redux-thunk": "2.3.0",
    "svgo": "1.3.0"
  }

image image

Interesting that when I call getUserManager in component methods like render, it works fine. Maybe it's related to the fact that setUserManager is not executed yet and , but I can't find where it's used (besides tests), and the only place I see userManager is set, is through authenticationServiceInternal.

image

ErwinSteffens commented 3 years ago

Same issue here.

Anybody has a workaround for this?