Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message with no keys #165

Closed
jb-reefer opened this issue Jul 11, 2019 · 2 comments
Closed

Confusing error message with no keys #165

jb-reefer opened this issue Jul 11, 2019 · 2 comments

Comments

@jb-reefer
Copy link

Describe the bug
When client side keys are not set, we get the following error message from the React SDK:

environment not found. Please see https://docs.launchdarkly.com/docs/js-sdk-reference#section-initializing-the-client for instructions on SDK initialization.

This implies that the environment hasn't been configured in LD, when it has - we just don't have any keys at all!

To reproduce
Instantiate an withLDProvider with clientSideID: undefined

Expected behavior
A more useful error message, like "clientSideID not provided"

Logs
clientSideID: LAUNCHDARKLY_CLIENT_ID,

SDK version
2.12.0 of launchdarkly-js-client-sdk

Language version, developer tools
Node 10

OS/platform
We see the above on all modern browsers

@bwoskow-ld
Copy link
Member

Hi @jb-reefer,

Thank you for the suggestion.

Prior to getting the environment not found message, you should have had a No environment specified message when initializing withLDProvider. As that's the first place that an error occurred, that's the most important console message to note. Each subsequent flag evaluation request will fail and log a environment not found message because withLDProvider wasn't initialized correctly.

The other part which is probably causing confusion is a terminology discrepancy:

  • LaunchDarkly's JavaScript SDK uses an env parameter when initializing the client.
  • LaunchDarkly's React SDK, whose implementation is heavily based on the JavaScript SDK, uses a clientSideID parameter when initializing the client.

Although the name is different, they're referring to the same thing; both of these parameters should be populated with what app.launchdarkly.com and our documentation refer to as the "client-side ID". The error messages refer to them as "environment" as that's what the JavaScript SDK calls it during initialization.

To make this more clear, we're taking your suggestion and updating these two messages to refer to both environment and client-side ID. This will be included in the next version of our JS and React SDKs (likely 2.12.5).

Cheers,
Ben

@eli-darkly
Copy link
Contributor

Fixed in the 2.12.5 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants