Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statsig fails to initialize #1

Open
apoteet opened this issue Jun 5, 2024 · 2 comments
Open

Statsig fails to initialize #1

apoteet opened this issue Jun 5, 2024 · 2 comments

Comments

@apoteet
Copy link

apoteet commented Jun 5, 2024

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
Copy link
Contributor

@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
Copy link
Author

apoteet commented Jun 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants