statsig-io / node-js-server-sdk

Statsig's SDK for server-side Node.js applications.
ISC License
21 stars 14 forks source link

node sdk v5 breaking imports #21

Closed tore-statsig closed 1 year ago

tore-statsig commented 1 year ago

While migrating our statsig-node usage from v4.9.2 to v5.3.0 an issue with interoperability when using typescript 4.5.5 without esModuleInterop enabled appeared. Previously we were using import * as statsig from 'stasig-node' without issues, however in the newest version any kind of standard typescript import fails accusing the named import as being undefined or the type not having the desired functions (full erros on thread). Currently enabling esModuleInterop is too costly for us, however the only solution working is the anti-patter usage of const statsig = require('statsig-node')

https://statsigcommunity.slack.com/archives/C01RAKM10TD/p1678996145270309

daniel-statsig commented 1 year ago

Fixed in v5.4.0 https://github.com/statsig-io/node-js-server-sdk/releases/tag/v5.4.0