Skip to content

Suppress NO_DATAFILE_SPECIFIED error when sdkKey is present #591

@aflinky

Description

@aflinky

What I wanted to do

Create instance of Optimizely with sdkKey (function createInstance) and without a datafile

What I expected to happen

As it says in the docs, the param datafile is not necessary if sdkKey is present (and vice versa)

What actually happened

The enums.ERROR_MESSAGES.NO_DATAFILE_SPECIFIED ("No datafile specified. Cannot start optimizely.") is thrown. Even though this doesn't cause the creation to break, it throws an error to the console (that my company has suppressed using a combination of a custom logger and custom error handling).

Steps to reproduce

optimizelyClientInstance = optimizely.createInstance({
  sdkKey: <optimizelySdkKey>,
});
  
const result = await optimizelyClientInstance.onReady({ timeout: 10000 });

@optimizely/optimizely-sdk version: 4.3.1

Browser and version: Chrome

node version: 14.6.0

npm version: 6.14.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions