Flutter腹板:应为"Element"类型的值,但获得的是legacyJavascript Object类型的值

uubf1zoe  于 2023-02-09  发布在  Flutter
关注(0)|答案(1)|浏览(226)

everyone. This is an error I'm seeing when loading my flutter web app in chrome:

Flutter Web Bootstrap: Programmatic

Error: Expected a value of type 'Element', but got one of type 'LegacyJavaScriptObject' dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 266:49 throw dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 99:3 castError dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 452:10 cast dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/classes.dart 635:14 as_C dart-sdk/lib/html/dart2js/html_dart2js.dart 11786:34 _get dart-sdk/lib/collection/list.dart 263:23 toList dart-sdk/lib/html/dart2js/html_dart2js.dart 11803:46 get iterator dart-sdk/lib/collection/list.dart 76:52 iterator] packages/wakelock_web/src/import_js_library.dart 64:27 _isLoaded packages/wakelock_web/src/import_js_library.dart 57:10 _isImported
The app never loads, and I see a blank screen.
Here is what my Flutter doctor command says:

It appears this is a new bug. Any help would be grateful!

von4xj4u

von4xj4u1#

此错误消息指示Flutter Web应用需要JavaScript库中类型为“Element”的对象,但收到的却是类型为“LegacyJavaScriptObject”的对象。如果JavaScript代码使用的是过时或不兼容的Dart SDK版本,则会发生此错误。你可以尝试更新Dart SDK或检查JavaScript库的文档以确保兼容性。

相关问题