pc-dart icon indicating copy to clipboard operation
pc-dart copied to clipboard

Support dart2wasm

Open leecommamichael opened this issue 1 year ago • 3 comments

To reproduce:

  • have the dart2wasm compiler
  • import this package into a main.dart with void main
  • run dart compile wasm main.dart Output:

../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.7.4/lib/src/platform_check/node_crypto.dart:5: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'; ^ ../../../AppData/Local/Pub/Cache/hosted/pub.dev/pointycastle-3.7.4/lib/src/platform_check/web.dart:5: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'; ^

This library impacts the popular package:image. I've filed a matching report with them here.

leecommamichael avatar Jan 28 '24 20:01 leecommamichael