You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, the export of the commonjs module is a Mixpanel library instance. It won't work to call individual methods without any binding to their instance.
Yeah, the export of the commonjs module is a Mixpanel library instance. It won't work to call individual methods without any binding to their instance.
So would you suggest using the default import instead?
Also worthy of a contribution to definitelyTyped so other TS devs don't make this mistake
Yes, the default export should work for you. It's the only one we document. I think it might be a pretty simple update for the lib to export a named version as well so you could do
Related to microsoft/TypeScript#45813
using the import syntax with mixpanel and typescript 4.4+ fails
using the default import works well though, but it is discouraged by linting rules such as https://github.com/import-js/eslint-plugin-import/blob/v2.25.2/docs/rules/no-named-as-default-member.md
The text was updated successfully, but these errors were encountered: