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

Add support for Web Assembly (WASM) in clevertap_plugin_web #270

Open
ritikjainx opened this issue Dec 4, 2024 · 1 comment
Open

Add support for Web Assembly (WASM) in clevertap_plugin_web #270

ritikjainx opened this issue Dec 4, 2024 · 1 comment

Comments

@ritikjainx
Copy link

Flutter web build with --wasm fails due to use of 'package:js/js.dart'
Issue in these files.

../../../../.pub-cache/hosted/pub.dev/clevertap_plugin-2.5.0/lib/src/clevertap_plugin_web_binding.dart:4:1: Error: JS interop library 'package:js/js.dart'
can't be imported when compiling to Wasm.
Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.
import 'package:js/js.dart';
^
../../../../.pub-cache/hosted/pub.dev/clevertap_plugin-2.5.0/lib/clevertap_plugin_web.dart:7:1: Error: JS interop library 'package:js/js_util.dart' can't be
imported when compiling to Wasm.
Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.
import 'package:js/js_util.dart' as js_util;
^
../../../../.pub-cache/hosted/pub.dev/clevertap_plugin-2.5.0/lib/clevertap_plugin_web.dart:8:1: Error: JS interop library 'package:js/js.dart' can't be
imported when compiling to Wasm.
Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.
import 'package:js/js.dart';

Steps to reproduce:

  1. Make a Flutter web project.
  2. Include Clevertap plugin in pubspec.yaml. - flutter pub add clevertap_plugin
  3. run Flutter build web --wasm

Ref: https://docs.flutter.dev/platform-integration/web/wasm#:~:text=own%20browser%20engine.-,Using%20compatible%20JS%20interop%20libraries,%23,-To%20support%20compilation

@anaghvj
Copy link

anaghvj commented Dec 9, 2024

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants