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

Typescript/ESM issue #54

Open
ethos-seth opened this issue Nov 2, 2024 · 2 comments
Open

Typescript/ESM issue #54

ethos-seth opened this issue Nov 2, 2024 · 2 comments

Comments

@ethos-seth
Copy link

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:

  1. Default imports
  2. Named imports

Each fails in their own way.

I suspect it might have something to do with:

module.exports = { default: Statsig as Statsig, ...Statsig };
@kenny-statsig
Copy link
Contributor

@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'

@bcherny
Copy link

bcherny commented Dec 4, 2024

@kenny-statsig that works at runtime, but TypeScript complains about it. Would love to see an upstream fix!

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

3 participants