Skip to content

TypeError: LegacyJavaScriptObject is not a subtype of DateTime on Flutter Web #397

@IvanDeluxe

Description

@IvanDeluxe

Description

When using Wiredash.trackEvent() on Flutter Web, we intermittently get the following error:

TypeError: Instance of 'LegacyJavaScriptObject': type 'LegacyJavaScriptObject' is not a subtype of type 'DateTime'

Stack Trace

DartError: TypeError: Instance of 'LegacyJavaScriptObject': type 'LegacyJavaScriptObject' is not a subtype of type 'FlutterErrorDetails'
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 274:3      throw_
dart-sdk/lib/_internal/js_shared/lib/rti.dart 1503:3                             _generalAsCheckImplementation
package:wiredash/src/an4lytics/an4lytics.dart 175:39                             <fn>
package:wiredash/src/core/wuid_generator.dart 99:3                               <fn>

Environment

  • Wiredash version: 2.6.0
  • Flutter version: 3.38.5
  • Dart SDK: >=3.10.0
  • Platform: Flutter Web (Chrome)

Steps to Reproduce

  1. Initialize Wiredash in a Flutter Web app
  2. Call Wiredash.trackEvent('event_name', data: {...})
  3. Error occurs intermittently

Workaround

Currently wrapping trackEvent in a try-catch to suppress the error:

try {
  Wiredash.trackEvent(name, data: logBody);
} catch (_) {
  // Wiredash has known issues on Flutter web - silently ignore
}

Expected Behavior

trackEvent should work without errors on Flutter Web.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions