Closed chrisvdp closed 4 years ago
According to the docs, it seems that bootstrapping https://docs.launchdarkly.com/sdk/client-side/javascript#bootstrapping might help, but I don't see any documentation on this. Is this something that this addon supports?
I was able to fix this in a fork with an updated launch darkly client. Version 2.10.0 of the launch darkly SDK allows for anonymous users which means I can ensure that the client is initialized sooner
We are calling
this.launchDarkly.variation('feature-flag')
within our code (the application controller), but based on network timing the client onReady event may not have fired yet. This means that the current value of_client
on https://github.com/ember-launch-darkly/ember-launch-darkly/blob/df0bd2567d896702cde8b6799902b0e4ba177324/addon/services/launch-darkly-client-remote.js#L61 is null, causing a TypeError:Ideally, the service would defend against
_service
as null, possibly by init'ing it tonullClient