This message was deleted.
# ask-questions
w
This message was deleted.
f
Can you log
growthbook.getFeatures()
? That should return all of the features loaded into the SDK
b
It is empty this object
But I can log the features I have for my environment
f
Hmm. So it's setting the features correctly at first, but when you later do
getFeatures()
it returns an empty object? Is there anywhere else in your code that is calling
setFeatures()
? Are you sure it's the exact same instance of GrowthBook and you aren't creating multiple ones?
b
maybe an obvious one, but just in case - you mentioned logging:
growthbook.evalFeature("feature_id")
But your feature is
hide-element
, not
feature_id
Or were you actually logging:
growthbook.evalFeature("hide-element")
b
The feature_id was an example, but thanks anyway!
@future-teacher-7046 Exactly, when I do
getFeatures()
returns an empty object. I'm calling the
setFeatures()
only once
Can it be any other configuration in the app?
f
You are calling
setFeatures()
inside of an async callback. Is it possible when you log
getFeatures()
it's before the fetch is done?
b
Yes, it seams that it is happening
147 Views