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

Unleash: unable to fetch feature toggles TypeError: Cannot read properties of undefined (reading 'find') #160

Closed
mavericardo opened this issue Feb 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mavericardo
Copy link

Describe the bug

I'm trying to check my feature toggle using the hook useFlag from @unleash/proxy-client-react But I'm getting the following error within library:

Screenshot 2024-02-21 at 10 48 58

Steps to reproduce the bug

  1. Makes the simple configuration
  2. Try uses the useFlag() hook

Expected behavior

Returns my feature flag information.

Logs, error output, etc.

No response

Screenshots

No response

Additional context

No response

Unleash version

"@unleash/proxy-client-react": "^3.6.0" - "unleash-proxy-client": "^2.5.0"

Subscription type

None

Hosting type

None

SDK information (language and version)

React

@mavericardo mavericardo added the bug Something isn't working label Feb 21, 2024
@mltsy
Copy link

mltsy commented Feb 22, 2024

Could you post your code for setting up the client and/or FlagProvider config?

I've gotten a similar error to this and it was because I didn't have the URL specified correctly. The error looks a bit like the toggles were never returned from the server (making toggles undefined), which could indicate an error in your configuration. 🤔

@FredrikOseberg
Copy link
Contributor

FredrikOseberg commented Feb 26, 2024

@mavericardo Thanks for the report. Could you provide a reproducable example here? I suspect there may be a configuration issue, even though the error message looks scary. I'd like to get to the bottom of this, so any information you could give me would be appreciated!

In particular I'm interested in:

  • Are you using any kind of bootstrapping mechanism? If so, what does the data look like.
  • Which URL are you configuring the client to hit to retrieve data. What does the data look like coming back from the API?

It looks to me like the client is configured with an URL that responds with data that does not match the schema.

@FredrikOseberg
Copy link
Contributor

Closing this for now. Feel free to re-open with new information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants