Closed jb-reefer closed 5 years ago
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:
env
parameter when initializing the client.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
Fixed in the 2.12.5 release.
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