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

v2.55.0 may break named imports #440

Open
dan-serendipity opened this issue Aug 8, 2024 · 2 comments
Open

v2.55.0 may break named imports #440

dan-serendipity opened this issue Aug 8, 2024 · 2 comments

Comments

@dan-serendipity
Copy link

Prior to v2.55.0, statements like import { init } from 'mixpanel-browser' were possible.
The most recent type definitions at @types/mixpanel-browser support this.
However, after upgrading to v2.55.0, if your bundler decides to start using mixpanel.module.js, you will get a runtime error: Uncaught SyntaxError: The requested module does not provide an export named 'init'.
The new esm module has the following export statement only export { mixpanel as default };

@tdumitrescu
Copy link
Member

Hmm I'm not sure how importing init worked before, but that was never a documented or supported usage. We don't control the 3rd-party type definitions. The public API has always been that you import the mixpanel object.

@dinesh-kumar-allen
Copy link

Yes post version 2.53 and above ESM tree shaking support for modules is limited and also resulted in bloating of bundle size from 20kB to 40kB (Gzip).
Bundlephobia link for reference: https://bundlephobia.com/package/[email protected]

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