Typescript/ESM issue
Hey folks, I have a project I just migrated to ESM and the the statsig client is giving me some trouble.
I put together a small sample project to demonstrate the issue I'm having: https://github.com/ethos-seth/statsig-esm-demo
It shows import two approaches:
- Default imports
- Named imports
Each fails in their own way.
I suspect it might have something to do with:
module.exports = { default: Statsig as Statsig, ...Statsig };
@ethos-seth Thanks for flagging this issue. We realize our export syntax does not work for ESM and are planning to address it. In the meantime, i'd recommend using the following import syntax import { default as Statsig } from 'statsig-node'
@kenny-statsig that works at runtime, but TypeScript complains about it. Would love to see an upstream fix!
@kenny-statsig Do you have any sort of timeline on a fix for this issue? We've been bitten by this a couple of times already and would really appreciate it if there weren't obvious footguns and the typescript types matched what node is expecting.