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

Uncaught MissingPluginException after deploying web version #92

Open
tejHackerDEV opened this issue Oct 4, 2022 · 11 comments
Open

Uncaught MissingPluginException after deploying web version #92

tejHackerDEV opened this issue Oct 4, 2022 · 11 comments

Comments

@tejHackerDEV
Copy link

Hi guys, I was using mixpanel in flutter web. When I am testing it in local, it is working fine but when I deployed it on firebase hosting, it started throwing error on Mixpanel.init() with the error "Uncaught MissingPluginException(No implementation found for method initialize on channel mixpanel_flutter)" & causing the app not be load. So please check this as it is blocking our release.

@LOCKEDFILE
Copy link

LOCKEDFILE commented Dec 26, 2022

Check your code in index.html

<head>
    // ~~~
    <script src="flutter.js" defer></script>
    <script src="./assets/packages/mixpanel_flutter/assets/mixpanel.js"></script>
</head>

It should be written END LINE OF HEAD.

@DamDam98
Copy link

I am having the same issue. My script tag is in the correct place in index.html

the package is working fine locally (in debug)

But when I deploy using firebase hosting it is throwing this error:
Uncaught MissingPluginException(No implementation found for method initialize on channel mixpanel_flutter)

@jemutorres
Copy link

jemutorres commented Jun 16, 2023

I am having this same problem in Flutter 3.10.2 with version 2.1.1.

In local environment it works correctly, but when deploying on Google App Engine the same error occurs: Uncaught MissingPluginException(No implementation found for method initialize on channel mixpanel_flutter)

pubspec.yaml:
mixpanel_flutter: ^2.1.1 # https://pub.dev/packages/mixpanel_flutter

index.html (at the end):

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

@jomonson
Copy link

For me the error was: PlatformException: Cannot read properties of undefined (reading 'init'), null, null).
Adding this to index.html fix the issue for both release and debug builds:

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

@Hannnes1
Copy link

Hannnes1 commented Jul 5, 2023

PlatformException: Cannot read properties of undefined (reading 'init'), null, null) is caused by a missing script tag, but MissingPluginException(No implementation found for method initialize on channel mixpanel_flutter) occurs even with the tag in place.

#91 suggests that the error occurs due to ad blockers, but I have the same issue even if all ad blockers are disabled and all calls to the mixpanel CDN returns 200. Both in chrome and firefox.

@devr-tech
Copy link

Any updates on this issue as I am currently facing the similar issue after deployed to Firebase Hosting.

@btribouillet
Copy link

Still having the issue in production, also on firebase hosting.

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

@arpit24sahu
Copy link

arpit24sahu commented Mar 12, 2024

Still facing this issue. Is there any plan to fix it as it has been in "Open" state for long.

@tejHackerDEV What did you use to get rid of this issue? Did you use some other package?

@Abdullah-Uppal
Copy link

What worked for me!!

flutter clean
flutter pub get

and then build

@pawelskinbrilla
Copy link

Hi there, I have the same issues. Please do something about it.

@vendoshi
Copy link

vendoshi commented Sep 11, 2024

I had the same issue. The reason for me was using adblocker. Mixpanel is a tracker so it was blocked.

Screenshot 2024-09-11 at 6 18 12 PM

Just add a try catch block in the init function.. it should be fine.

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