Error with NodeJS SDK: A listener was added for SDK_READY on the SDK

Comments

5 comments

  • Official comment
    Kevin Li

    Rodrigo, the reason I asked Tom to communicate over email was due to the fact that in order to properly troubleshoot the issue, I needed to ask him more about his specific implementation that shouldn't be shared. If this is happening for you, I'd suggest that you submit a ticket here: https://help.split.io/hc/en-us/requests/new

    In terms of high level guidance, if you have code executing exactly in the order as provided above, the SDK shouldn't be firing the ready event before you hook up the listener. Its highly likely that something else is happening on your app in between the call for `var client = factory.client();` and `client.on(client.Event.SDK_READY, function() {};` so we'd want to understand a bit more in depth about the exact order of execution in your application.

     

  • Kevin Li

    Hi Tom, The error you're seeing there means that the client's Ready event is firing before you hook up the listener so that event won't fire. It'll probably be best for us to chat directly about your setup more in depth to get this resolved. Look for an email from our support team here!

  • Rodrigo Garcia

    Why don't you help us all by posting the solution? This could be a great way to solve a mutual problem

  • Jaafar Skafi

    I also have this issue.

  • Kevin Li

    Jaafar, from my comment above, if you have code executing exactly in the order as provided above, the SDK shouldn't be firing the ready event before you hook up the listener. Its highly likely that something else is happening on your app in between the call for `var client = factory.client();` and `client.on(client.Event.SDK_READY, function() {};` so we'd want to understand a bit more in depth about the exact order of execution in your application.

     

    Can you confirm that you're instantiating the client and then immediately listening for the ready event to fire? If so, then I'd definitely recommend submitting a ticket as that would not be expected behavior

Please sign in to leave a comment.