小编asa*_*cal的帖子

Optimizely object is not valid. Failing isFeatureEnabled

Trying to use the React and JavaScript SDKs for Optimizely, but getting the following error in the console:

OPTIMIZELY: Optimizely object is not valid. Failing isFeatureEnabled.
Run Code Online (Sandbox Code Playgroud)

More info about my setup below:

Installed via Yarn: yarn add @optimizely/react-sdk

Import statement in the app container:

import {
  createInstance
} from '@optimizely/react-sdk'
Run Code Online (Sandbox Code Playgroud)

Logic in render function:

const optimizely = createInstance({
  sdkKey: '<SDK_KEY>',
})

const enabled = optimizely.isFeatureEnabled('example_feature', 'user123');
Run Code Online (Sandbox Code Playgroud)

I get this error in the Chrome console:

OPTIMIZELY: Optimizely object is not …
Run Code Online (Sandbox Code Playgroud)

optimizely

5
推荐指数
1
解决办法
1287
查看次数

标签 统计

optimizely ×1