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

TypeError: Cannot read properties of undefined (reading '_logger') #6

Open
MinskLeo opened this issue Apr 3, 2024 · 1 comment
Open
Labels

Comments

@MinskLeo
Copy link

MinskLeo commented Apr 3, 2024

Description

Hi. I have this error when I'm trying to call zitadel.userManager.signinRedirectCallback.

Environment

NX monorepo with regular Vite React app + TypeScript.

Lib version:

"@zitadel/react": "^1.0.2",

How instance created:

const config: ZitadelConfig = {
  authority: 'https://zitadel.my-domain.dev',
  client_id: '261132704165220354@testproject',
  redirect_uri: 'http://localhost:4200/callback',
  post_logout_redirect_uri: 'http://localhost:4200',
};

Error:

index.tsx:15 Callback parsing error:  TypeError: Cannot read properties of undefined (reading '_logger')
    at signinRedirectCallback (@zitadel_react.js?v=2ca991b3:3410:26)
    at index.tsx:13:15
    at index.tsx:20:5
    at commitHookEffectListMount (react-dom_client.js?v=2ca991b3:16904:34)
    at commitPassiveMountOnFiber (react-dom_client.js?v=2ca991b3:18152:19)
    at commitPassiveMountEffects_complete (react-dom_client.js?v=2ca991b3:18125:17)
    at commitPassiveMountEffects_begin (react-dom_client.js?v=2ca991b3:18115:15)
    at commitPassiveMountEffects (react-dom_client.js?v=2ca991b3:18105:11)
    at flushPassiveEffectsImpl (react-dom_client.js?v=2ca991b3:19486:11)
    at flushPassiveEffects (react-dom_client.js?v=2ca991b3:19443:22)

Library source code chunk:

  async signinRedirectCallback(url = window.location.href) {
    // ----- On line below error -----
    const logger2 = this._logger.create("signinRedirectCallback");
   // -------------------------------

    const user = await this._signinEnd(url);
    if (user.profile && user.profile.sub) {
      logger2.info("success, signed in subject", user.profile.sub);
    } else {
      logger2.info("no subject");
    }
    return user;
  }

Maybe someone already found a way how to fix error? Or maybe I did something wrong. I can provide React app for reproduction later if needed.

@muhlemmer muhlemmer added the devx label Apr 4, 2024
@muhlemmer
Copy link

@peintnermax if you have some time, can you have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🧐 Investigating
Development

No branches or pull requests

2 participants