Skip to content

Bug: Client is undefined in getToken function #53

Open
@pwaltron

Description

Prerequisites

Describe the issue

We have noticed, usually after a refresh of our application, an error being logged to the console from the SDK;

TypeError: Cannot read properties of undefined (reading 'getToken')
at KindeProvider.tsx:176:1

Is appears that client is undefined when we call the getToken function. To get around this we are using getToken within a useEffect hook essentially until we get a returned value. This issue is compounded by #45 as the promise is rejected with an undefined error due to being console logged in the sdk directly.

Additionally, we have noticed that the getToken function is declared in kinde-auth-pkce-js/index as having 0 arguments however one argument is being passed in at KindeProvider.tsx:176. It doesn't look like this causes the above issue, but it was a warning from our IDE

Library URL

https://github.com/kinde-oss/kinde-auth-react

Library version

4.0.1

Operating system(s)

macOS

Operating system version(s)

Sonoma 14.0

Further environment details

No response

Reproducible test case URL

No response

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions