initialization errors aren't always surfaced
Closed this issue · 6 comments
This issue was originally filed by @martinmckenna when the React SDK code was still part of the js-client-sdk repository. The original issue description and discussion is here.
Summary: in the specific case where an environment ID was not provided, the underlying JS SDK will fail to initialize but this type of failure is not communicated to the React SDK, so it will hang.
The original issue also mentioned the possibility of an existing environment ID becoming invalid so that LD would return a 401 or 403 error. We believe that in this case the React SDK will notice the error, but we should verify that.
[tracked internally as 55120]
Any updates on this issue?
Hello Launch Darkly team! Also wondering if there are updates on this issue? Hoping to have a React-based way of identifying an ldClient
initialization error and being able to retry connecting to LD
@Lukortech @Jshollow A solution for this went out in 2.27.0, take a look and see if it suits your needs. We added a new hook that will surface initialization failures, read useLDClientError.
@Lukortech @Jshollow A solution for this went out in 2.27.0, take a look and see if it suits your needs. We added a new hook that will surface initialization failures, read useLDClientError.
Thanks for the mention, I am not a part of active team working with use of this sdk but I will try to see if It's good now.
@XieX I could not see any references on how to use useLDClientError