Open markusrubey opened 1 year ago
I am also running into the same issue in production. Did you find any solution to that @markusrubey?
minified:jI: PlatformException(error, NoSuchMethodError: method not found: 'track' (mixpanel.track is not a function. (In 'mixpanel.track(o,A.ae(r))', 'mixpanel.track' is undefined)), null, null)
cc @zihejia
Hi @bselwe, @zihejia and @markusrubey I am facing this issue while running version 2.2.0 of the library locally in Chrome. Have you found a solution or workaround? Thank you!
Anyone found any fixes? Is this resolved in latest 2.3.0 version?
I have the same issue only on release mode for web.
And I'm block to the version 2.2.0 of mixpanel because to upgrade to 2.3.0
I need to change to much package in my app ...
for the moment, I turned of mixpanel on web on my project :/
I followed the set up instructions from pub dev and also checked your example here. I have no issues under debug. My call to
Mixpanel.init
throws no error.I noticed I am missing some functionality in my main.dart.js when comparing:
Mixpanel Example main.dart.js
```js A.Mixpanel.prototype = { hasOptedOutTracking$0() { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_bool), $async$returnValue; var $async$hasOptedOutTracking$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); while (true) switch ($async$goto) { case 0: // Function start $async$goto = 3; return A._asyncAwait(B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("hasOptedOutTracking", null, false, type$.bool), $async$hasOptedOutTracking$0); case 3: // returning from await. $async$returnValue = $async$result; // goto return $async$goto = 1; break; case 1: // return return A._asyncReturn($async$returnValue, $async$completer); } }); return A._asyncStartSync($async$hasOptedOutTracking$0, $async$completer); }, identify$1(distinctId) { if (distinctId.length !== 0) B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("identify", A.LinkedHashMap_LinkedHashMap$_literal(["distinctId", distinctId], type$.String, type$.dynamic), false, type$.void); else A.log0("`identify` failed: distinctId cannot be blank", "Mixpanel"); }, alias$2(alias, distinctId) { if (alias.length === 0) { A.log0("`alias` failed: alias cannot be blank", "mixpanel"); return; } if (distinctId.length === 0) { A.log0("`alias` failed: distinctId cannot be blank", "Mixpanel"); return; } B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("alias", A.LinkedHashMap_LinkedHashMap$_literal(["alias", alias, "distinctId", distinctId], type$.String, type$.dynamic), false, type$.void); }, track$2$properties(_, eventName, properties) { if (eventName.length !== 0) B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("track", A.LinkedHashMap_LinkedHashMap$_literal(["eventName", eventName, "properties", properties], type$.String, type$.dynamic), false, type$.void); else A.log0("`track` failed: eventName cannot be blank", "Mixpanel"); }, track$1($receiver, eventName) { return this.track$2$properties($receiver, eventName, null); }, getSuperProperties$0() { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Map_dynamic_dynamic), $async$returnValue; var $async$getSuperProperties$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); while (true) switch ($async$goto) { case 0: // Function start $async$goto = 3; return A._asyncAwait(B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("getSuperProperties", null, false, type$.Map_dynamic_dynamic), $async$getSuperProperties$0); case 3: // returning from await. $async$returnValue = $async$result; // goto return $async$goto = 1; break; case 1: // return return A._asyncReturn($async$returnValue, $async$completer); } }); return A._asyncStartSync($async$getSuperProperties$0, $async$completer); }, getDistinctId$0() { var t1 = type$.String; return B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("getDistinctId", null, false, t1).then$1$1(new A.Mixpanel_getDistinctId_closure(), t1); }, flush$0(_) { var $async$goto = 0, $async$completer = A._makeAsyncAwaitCompleter(type$.void); var $async$flush$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { if ($async$errorCode === 1) return A._asyncRethrow($async$result, $async$completer); while (true) switch ($async$goto) { case 0: // Function start $async$goto = 2; return A._asyncAwait(B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("flush", null, false, type$.dynamic), $async$flush$0); case 2: // returning from await. // implicit return return A._asyncReturn(null, $async$completer); } }); return A._asyncStartSync($async$flush$0, $async$completer); } }; ```My Project main.dart.js
```js A.Mixpanel.prototype = { track$2$properties(_, eventName, properties) { if (eventName.length !== 0) B.MethodChannel_0nx._invokeMethod$1$3$arguments$missingOk("track", A.LinkedHashMap_LinkedHashMap$_literal(["eventName", eventName, "properties", properties], type$.String, type$.dynamic), false, type$.void); } }; ```