mixpanel / mixpanel-js

Official Mixpanel JavaScript Client Library
https://mixpanel.com/help/reference/javascript
Other
884 stars 308 forks source link

v2.55.0 may break named imports #440

Open dan-serendipity opened 1 month ago

dan-serendipity commented 1 month ago

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 commented 1 month ago

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.