https://www.growthbook.io/ logo
s

sticky-insurance-60813

08/05/2022, 9:49 PM
trying first time and getting this error. Anyone knows how to solve this? Error in function feature in ./node_modules/@growthbook/growthbook-react/dist/esm/index.js:51 growthbook.feature is not a function.
f

fresh-football-47124

08/05/2022, 9:49 PM
Hi Arpan - I assume this with the react SDK implementation?
s

sticky-insurance-60813

08/05/2022, 9:51 PM
yes
f

fresh-football-47124

08/05/2022, 9:52 PM
can you share the code where you're adding the sdk?
s

sticky-insurance-60813

08/05/2022, 9:53 PM
yes in global layout
message has been deleted
and they trying to use in components like this
const myFeature = useFeature("open-account-link").on;
console.log(myFeature)
trying to run equal split a/b test. api returns this
*{*"status": *200*,
"features": *{*"open-account-link": *{*"defaultValue": *false*,
"rules": *[{*"variations": *[false*,
true
*]*,
"coverage": *1*,
"weights": *[0.5*,
0.5
*]*,
"key": "open-account-link",
"hashAttribute": "id"
}
]
}
}
}
f

fresh-football-47124

08/05/2022, 9:59 PM
that looks correct
s

sticky-insurance-60813

08/05/2022, 9:59 PM
is there any mistake I made in a/b test config in growthbook cloud?
message has been deleted
should I keep ON for both variations in SERVE table?
f

fresh-football-47124

08/05/2022, 10:05 PM
the UI side looks good
are you still getting that JS error?
s

sticky-insurance-60813

08/05/2022, 10:05 PM
yes
f

future-teacher-7046

08/05/2022, 10:11 PM
It looks like in the GrowthBookProvider, you accidentally passed in a string instead of the growthbook object
👍 1
f

fresh-football-47124

08/05/2022, 10:11 PM
oh good catch
didn't see the quotes
s

sticky-insurance-60813

08/05/2022, 10:12 PM
thanks. trying again
I am confused by serve table in growthbook. Not sure when should I turn it ON or OFF? Also when Name is used. I don’t see name included in API response
f

fresh-football-47124

08/05/2022, 10:15 PM
those two cases in your experiment rule have two different values (on and off) it's up to you to see whatever values you want - if you set them to the same, you'll be running an A/A test
The experiment key, I assume you mean, is used in the trackingCallback - you should see it in your console log
s

sticky-insurance-60813

08/05/2022, 10:18 PM
so for a/b test which should I leave one on and another off?
f

fresh-football-47124

08/05/2022, 10:18 PM
it doesn't matter really - but typically 0'th index is the control (so off)
s

sticky-insurance-60813

08/05/2022, 10:19 PM
ok and by name I mean next column values which is default and fivision in pic I shared. I don’t see those in api response
what are they used for?
f

fresh-football-47124

08/05/2022, 10:19 PM
oh, thats for growthbook users
sometimes 'on' and 'off' are hard to parse - so you can use that name for something more understandable - like 'showing new version of x'
s

sticky-insurance-60813

08/05/2022, 10:29 PM
what is difference between features and experiments in growthbook dev tools?
I set both to true but I still see below code return false
useFeature("open-account-link").on
f

fresh-football-47124

08/05/2022, 10:30 PM
whats the json returning now?
s

sticky-insurance-60813

08/05/2022, 10:32 PM
you mean api response? wouldn’t it be same as previous as we have just changed it in devtools but not actually changed it?
f

fresh-football-47124

08/05/2022, 10:32 PM
oh
I've sometimes had some problems with the devtools - you can make sure the SDK is working correctly by adjusting the id: "123" to something else to rebucket you, and see if you get the other variations
the devtools is just for debugging
s

sticky-insurance-60813

08/08/2022, 3:00 PM
oh marketing team can’t use that dev tools to swap different variations at will?