Skip to content

web打包报错 #238

Description

@ninescore

``Wasm dry run findings:
Found incompatibilities with WebAssembly.

package:ali_auth/ali_auth_web_api.dart 5:7 - The '@js' annotation from 'dart:js_interop' can only be used for static interop, either through extension types or '@staticInterop' classes. (2)
package:ali_auth/ali_auth_web_api.dart 28:7 - The '@js' annotation from 'dart:js_interop' can only be used for static interop, either through extension types or '@staticInterop' classes. (2)
package:ali_auth/ali_auth_web_api.dart 69:31 - Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'. (2)
package:ali_auth/ali_auth_web_api.dart 70:27 - Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'. (2)
package:ali_auth/ali_auth_web_api.dart 85:31 - Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'. (2)
package:ali_auth/ali_auth_web_api.dart 86:27 - Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'. (2)

Consider addressing these issues to enable wasm builds. See docs for more info: https://docs.flutter.dev/platform-integration/web/wasm

Use --no-wasm-dry-run to disable these warnings.
Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:5:7:
Error: The '@js' annotation from 'dart:js_interop' can only be used for static interop, either through extension types or '@staticInterop' classes.
class PhoneNumberServer {
^
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:28:7:
Error: The '@js' annotation from 'dart:js_interop' can only be used for static interop, either through extension types or '@staticInterop' classes.
class Params {
^
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:69:31:
Error: Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'.
final jsSuccess = success.toJS;
^
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:70:27:
Error: Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'.
final jsError = error.toJS;
^
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:85:31:
Error: Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'.
final jsSuccess = success.toJS;
^
/D:/depository/Pub/Cache/hosted/pub.flutter-io.cn/ali_auth-1.3.9/lib/ali_auth_web_api.dart:86:27:
Error: Function converted via 'toJS' contains invalid types in its function signature: 'void Function(dynamic)'.
final jsError = error.toJS;
^
Error: Compilation failed.
Command: D:\tools\flutter\flutter\bin\cache\dart-sdk\bin\dart.exe compile js --platform-binaries=D:\tools\flutter\flutter\bin\cache\flutter_web_sdk\kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_VERSION=3.38.3 -DFLUTTER_CHANNEL=stable -DFLUTTER_GIT_URL=https://github.com/flutter/flutter.git -DFLUTTER_FRAMEWORK_REVISION=19074d12f7 -DFLUTTER_ENGINE_REVISION=13e658725d -DFLUTTER_DART_VERSION=3.10.1 -DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_USE_SKWASM=false -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/13e658725ddaa270601426d1485636157e38c34c/ --native-null-assertions --no-source-maps -O4 --minify -o D:\work\flutter\wu.dart_tool\flutter_build\da5c4283b45c04cbea1f7588cf5c9fc4\app.dill --packages=D:\work\flutter\wu.dart_tool\package_config.json --cfe-only D:\work\flutter\wu.dart_tool\flutter_build\da5c4283b45c04cbea1f7588cf5c9fc4\main.dart
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:153:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:379:19)

#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:207:5)

#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:873:9)

#4 Future.wait. (dart:async/future.dart:546:21)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions