mixpanel-flutter
mixpanel-flutter copied to clipboard
Flutter WEB - fails to send events and doesn't load proper CDN file
Hey, thanks for this great library 🙌
It works well on mobile for me, but I'm having issues trying to make it work on Flutter web.
Looks like the file from your CDN isn't getting loaded properly or the URL is pointing to a wrong one. Bellow's the error from console.
I have all the setup properly ready as stated in the docs:
- I've added the bellow script in between tags, as stated in docs:
<script src="./assets/packages/mixpanel_flutter/assets/mixpanel.js"></script>
- I successfully initialize Mixpanel in Dart code (as mentioned, Mixpanel works fine on mobile).
This error stops if I add some JS inside index.html
and override the variableMIXPANEL_CUSTOM_LIB_URL
and set custom URL. This is the URL I've found online: https://cdn.jsdelivr.net/npm/[email protected]/dist/mixpanel-jslib-snippet.min.js
But still, the events are not being sent to MixPanel 😐 I also tried different versions from 2.52.0 to 2.47.0.
EDIT:
My Flutter version is 3.22.2
and mixpanel_flutter: ^2.3.1
. I also tried other versions of the package, 2.2.0
and 2.0
- doesnt work in any. I've also tried with Flutter version 3.19.0
.