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
{{ message }}
Repository navigation
missing var declaration on mixpanel-jslib-snippet.jsΒ #215
As I'm using the snippet source code to load mixpanel lib from my Typescript code asynchronously. The Typescript compiler is complaining about those missing var declarations.
If you wonder why I'm using the snippet code directly in my Typescript files, it's because I don't want to include the snippet in my index.html as I want to keep scripts in the index.html file to a minimum to avoid blocking the UI thread.
I think this approach is a nice workaround for this issue.
Thanks for the catch! We'll get it in an upcoming release, though you can always expedite by submitting a PR.
Re: bundling the async loader ("snippet"): that's a workable approach as long as you ensure you always run that JS bundle before you ever try to access window.mixpanel. The minified snippet is designed to be small enough to put in a page's <head> tag without any noticeable delay, and then you don't have to worry about loading order at all. The issue being discussed in #128 is different: the problem there is the size of the actual library code, which will only affect you when you try to put the entire lib in your bundles (i.e. bypassing the async loader altogether).
Activity
tdumitrescu commentedon Apr 9, 2019
Thanks for the catch! We'll get it in an upcoming release, though you can always expedite by submitting a PR.
Re: bundling the async loader ("snippet"): that's a workable approach as long as you ensure you always run that JS bundle before you ever try to access
window.mixpanel. The minified snippet is designed to be small enough to put in a page's<head>tag without any noticeable delay, and then you don't have to worry about loading order at all. The issue being discussed in #128 is different: the problem there is the size of the actual library code, which will only affect you when you try to put the entire lib in your bundles (i.e. bypassing the async loader altogether).tdumitrescu commentedon Feb 18, 2022
Sorry this slipped under the radar; it's been fixed in v2.45.0.
Merge pull request #215 from mixpanel/jg-incr-seqNo-currentreplay