cool-doctor-39582
01/30/2025, 4:55 AMtest-feature
) is always returning false
, Halp?brief-honey-45610
01/30/2025, 3:47 PMcool-doctor-39582
01/30/2025, 5:21 PMcool-doctor-39582
01/30/2025, 5:21 PMstrong-mouse-55694
01/30/2025, 8:02 PMcool-doctor-39582
01/30/2025, 8:20 PMcool-doctor-39582
01/30/2025, 8:21 PMcool-doctor-39582
01/30/2025, 8:22 PMstrong-mouse-55694
01/30/2025, 8:47 PMtest-feature
?cool-doctor-39582
01/30/2025, 8:52 PMcool-doctor-39582
01/30/2025, 8:53 PMcool-doctor-39582
01/30/2025, 8:53 PMtest_feature
to test-feature
- same resultcool-doctor-39582
01/30/2025, 9:18 PM{
isBrowser: false,
GROWTHBOOK_URL: '<https://cdn.growthbook.io>',
GROWTHBOOK_KEY: 'sdk-YhNvQAT3LV7iMGzY'
}
cool-doctor-39582
01/30/2025, 9:19 PMcool-doctor-39582
01/30/2025, 9:20 PMstrong-mouse-55694
01/30/2025, 9:20 PMcool-doctor-39582
01/30/2025, 9:20 PMcool-doctor-39582
01/30/2025, 9:21 PMstrong-mouse-55694
01/30/2025, 9:23 PMconst gb = useGrowthBook();
console.log(gb.getFeatures())
cool-doctor-39582
01/30/2025, 9:24 PMcool-doctor-39582
01/30/2025, 9:24 PMcool-doctor-39582
01/30/2025, 9:24 PMstrong-mouse-55694
01/30/2025, 9:25 PMuseGrowthBook
hook.cool-doctor-39582
01/30/2025, 9:27 PM{}
cool-doctor-39582
01/30/2025, 9:27 PMcool-doctor-39582
01/30/2025, 9:28 PMcool-doctor-39582
01/30/2025, 9:28 PMcool-doctor-39582
01/30/2025, 9:29 PMisBrowser
conditional inverted in the ternarycool-doctor-39582
01/30/2025, 9:29 PMconst isBrowser = typeof window !== 'undefined';
const GROWTHBOOK_URL = (isBrowser ? import.meta.env.VITE_GROWTHBOOK_URL : process.env.VITE_GROWTHBOOK_URL) as string;
const GROWTHBOOK_KEY = (isBrowser ? import.meta.env.VITE_GROWTHBOOK_KEY : process.env.VITE_GROWTHBOOK_KEY) as string;
cool-doctor-39582
01/30/2025, 9:29 PMcool-doctor-39582
01/30/2025, 9:30 PMawait
somewhere?strong-mouse-55694
01/30/2025, 9:34 PMcool-doctor-39582
01/30/2025, 9:35 PM{"status":200,"features":{},"dateUpdated":"2025-01-28T05:05:09.082Z"}
strong-mouse-55694
01/30/2025, 9:36 PMcool-doctor-39582
01/30/2025, 9:36 PMstrong-mouse-55694
01/30/2025, 9:37 PMcool-doctor-39582
01/30/2025, 9:38 PMcool-doctor-39582
01/30/2025, 9:38 PMcurl '<https://cdn.growthbook.io/api/features/sdk-YhNvQAT3LV7iMGzY>' \
-H 'accept: */*' \
-H 'accept-language: en-US,en;q=0.9' \
-H 'cache-control: no-cache' \
-H 'origin: <http://localhost:5173>' \
-H 'pragma: no-cache' \
-H 'priority: u=1, i' \
-H 'referer: <http://localhost:5173/>' \
-H 'sec-ch-ua: "Not A(Brand";v="8", "Chromium";v="132", "Google Chrome";v="132"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'sec-fetch-dest: empty' \
-H 'sec-fetch-mode: cors' \
-H 'sec-fetch-site: cross-site' \
-H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36'
cool-doctor-39582
01/30/2025, 9:39 PMstrong-mouse-55694
01/30/2025, 9:42 PMcool-doctor-39582
01/30/2025, 9:43 PMcool-doctor-39582
01/30/2025, 9:43 PMstrong-mouse-55694
01/30/2025, 9:43 PMstrong-mouse-55694
01/30/2025, 9:44 PMcool-doctor-39582
01/30/2025, 9:47 PMdev
instead of production
I changed it to production
, and now:
• The test-feature
flag reports true
in the browser
• But it still reports false
when rendered server-sidecool-doctor-39582
01/30/2025, 9:50 PMtrue
cool-doctor-39582
01/30/2025, 9:50 PMcool-doctor-39582
01/30/2025, 9:50 PMcool-doctor-39582
01/30/2025, 9:51 PMstrong-mouse-55694
01/30/2025, 10:02 PMcool-doctor-39582
01/30/2025, 10:03 PMcool-doctor-39582
01/30/2025, 10:05 PM