Open thudaydelight opened 1 month ago
Basically, because wasm build is not supported on stable channel, I don't ensure that pdfrx runs on it. But I've just removed dependency on js_util.
@espresso3389
Thank you, i am waiting pdfrx support wasm when wasm will be supported on stable channel
I need to use Flutter Web with wasm for the application.
``
../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:7:1: Error: JS interop library 'dart:js_util' can't be imported when compiling to Wasm. Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead. import 'dart:js_util'; ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:122:14: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. double offsetX = 0, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:123:14: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. double offsetY = 0, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:124:12: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. bool dontFlip = false}); ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:168:14: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. String intent = 'display', ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:169:11: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. int annotationMode = 1, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:170:12: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. bool renderInteractiveForms = false, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:207:10: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. bool includeMarkedContent = false, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:208:10: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. bool disableNormalization = false, ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdf.js.dart:267:12: Warning: Initializers for parameters are ignored on static interop external functions. Declare a forwarding non-external function with this initializer, or remove the initializer. String intent = 'display', ^ ../../.pub-cache/hosted/pub.dev/pdfrx-1.0.50/lib/src/web/pdfrx_web.dart:6:1: Error: JS interop library 'dart:js_util' can't be imported when compiling to Wasm. Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead. import 'dart:js_util' as js_util; ^ Command: /Users/daydelight/fvm/versions/master/bin/cache/dart-sdk/bin/dart compile wasm --packages=.dart_tool/package_config.json --extra-compiler-option=--dart-sdk=/Users/daydelight/fvm/versions/master/bin/cache/dart-sdk --extra-compiler-option=--platform=/Users/daydelight/fvm/versions/master/bin/cache/flutter_web_sdk/kernel/dart2wasm_platform.dill --extra-compiler-option=--delete-tostring-package-uri=dart:ui --extra-compiler-option=--delete-tostring-package-uri=package:flutter --extra-compiler-option=--import-shared-memory --extra-compiler-option=--shared-memory-max-pages=32768 -Ddart.vm.product=true -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/4f6b832c8e333775f2c217a821050543a110826e/ -DFLUTTER_WEB_AUTO_DETECT=false -DFLUTTER_WEB_USE_SKIA=false -DFLUTTER_WEB_USE_SKWASM=true --extra-compiler-option=--depfile=/Users/daydelight/study/webassembly/.dart_tool/flutter_build/b49f125fa6955c85159dd2d865c4d882/dart2wasm.d -O4 --no-name-section -o /Users/daydelight/study/webassembly/.dart_tool/flutter_build/b49f125fa6955c85159dd2d865c4d882/main.dart.wasm /Users/daydelight/study/webassembly/.dart_tool/flutter_build/b49f125fa6955c85159dd2d865c4d882/main.dart
0 RunResult.throwException (package:flutter_tools/src/base/process.dart:125:5)
1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:321:19)