statsig-io / node-js-lite-server-sdk

ISC License
2 stars 0 forks source link

Statsig fails to initialize #1

Open apoteet opened 3 months ago

apoteet commented 3 months ago

I'm trialing the Statsig SDK right now. It worked well, but wasn't the fastest to init. I was directed to try the lite version, but I'm getting these two error logs on startup:

ERROR: statsigSDK::initialize> Failed to initialize from the network. See https://docs.statsig.com/messages/serverSDKConnection for more information

WARN:

TypeError: M6.apply is not a function
    at HJ (/var/task/index.js:43:439935)
    at t.post (/var/task/index.js:44:75774)
    at t.<anonymous> (/var/task/index.js:44:14273)
    at p (/var/task/index.js:44:1577)
    at Object.next (/var/task/i...

This still seems to return a client, but it evaluates my gate as false when it should be true. I'm using the SDK the same way i used the full SDK (pared down snippet):

import statsig from 'statsig-node-lite'

async function getPlatformGateSs(flagName: string, user: StatsigUser): Promise<boolean> {
  await statsig.initialize(secretKey) // I also tried passing { environment: { tier: 'development' } }
  return client.checkGateSync(user, flagName)   // false
}

Should i be including something else in the init call?

kenny-statsig commented 3 months ago

@apoteet that error usually indicates either a transient request failure, network configuration issue (i.e. access to network requests disabled), or the provided SDK key is invalid. Can you verify that none of the above applies to you?

The SDK appears to be operating fine from our side.

apoteet commented 3 months ago

I don't think any of those would be true for my case, since the full SDK worked just fine? I left the lite SDK running with errors for about an hour before switching back, so i don't think it's transient either. This is running in a lambda environment FWIW