You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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).
Describe the bug
When client side keys are not set, we get the following error message from the React SDK:
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
withclientSideID: 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
The text was updated successfully, but these errors were encountered: