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

Flutter WEB - fails to send events and doesn't load proper CDN file #149

Open
k00na opened this issue Jun 14, 2024 · 1 comment
Open

Flutter WEB - fails to send events and doesn't load proper CDN file #149

k00na opened this issue Jun 14, 2024 · 1 comment

Comments

@k00na
Copy link

k00na commented Jun 14, 2024

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.

image

I have all the setup properly ready as stated in the docs:

  1. I've added the bellow script in between tags, as stated in docs:

<script src="./assets/packages/mixpanel_flutter/assets/mixpanel.js"></script>

  1. 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.

@k00na k00na changed the title Flutter WEB - fails to load proper JS file from CDN Flutter WEB - fails to send events and doesn't load proper CDN file Jun 18, 2024
@CH1NRU5T
Copy link

CH1NRU5T commented Oct 2, 2024

Hey, @k00na can you please attach the modified index.html here, without your js code which overrides the variable MIXPANEL_CUSTOM_LIB_URL ?

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

2 participants