gpt4 book ai didi

html - Dart WebUI 构建错误

转载 作者:行者123 更新时间:2023-11-28 03:33:32 25 4
gpt4 key购买 nike

我在将 web_ui 添加到我现有的 dart 应用程序时遇到问题。我什至没有将任何特定于 webui 的代码添加到我的 html 文件中,我只是在尝试构建。

我将 web_ui 添加到 pubspec.yaml 并运行 pub install。

当我运行我的 build.dart 文件时,它生成:

Uncaught Error: type 'AttributeName' is not a subtype of type 'String' of 'name'.

这是我的 build.dart 文件的样子(它在我项目的根目录中):

import 'package:web_ui/component_build.dart';
import 'dart:io';

void main() {
build(new Options().arguments, ['bin/mywebpage.html']);
}

同样值得注意的是,我尝试了他们自动生成的 webUI 示例并且它有效,我只是无法将它添加到我现有的项目中。

编辑:

  1. 是的,通常是index.html,但没什么区别。我确实尝试过改变它。我正在运行最新版本的 Dart M4。

  2. 当我在 Dartium 中运行 mywebpage.html 时,我没有收到任何错误,但是 {{dataValue}} 没有被其对应的数据替换。

  3. Dart 编辑器版本 0.4.7_r21658Dart SDK 版本 0.4.7.5_r21658

这就是我得到的所有信息,有趣的是 clipPath 并不意外,它正在关闭一个打开的 clipPath 标签:

warning bin/mywebsite.html:86:3: Unexpected end tag (clippath). Ignored.
</clipPath>
^^^^^^^^^^^
warning bin/mywebsite.html:99:3: Unexpected end tag (clippath). Ignored.
</clipPath>
^^^^^^^^^^^
Uncaught Error: type 'AttributeName' is not a subtype of type 'String' of 'name'.
Stack Trace:
#0 _Analyzer.visitAttribute (package:web_ui/src/analyzer.dart:403:48)
#1 _Analyzer.visitElementInfo.<anonymous closure> (package:web_ui/src/analyzer.dart:157:53)
#2 LinkedHashMap.forEach (dart:collection-patch:241:13)
#3 _Analyzer.visitElementInfo (package:web_ui/src/analyzer.dart:157:28)
#4 _Analyzer.visitElement (package:web_ui/src/analyzer.dart:123:21)
#5 TreeVisitor.visit (package:html5lib/dom_parsing.dart:15:50)
#6 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:27:49)
#7 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:35:48)
#8 TreeVisitor.visitElement (package:html5lib/dom_parsing.dart:44:50)
#9 _Analyzer.visitElementInfo (package:web_ui/src/analyzer.dart:175:23)
#10 _Analyzer.visitElement (package:web_ui/src/analyzer.dart:123:21)
#11 TreeVisitor.visit (package:html5lib/dom_parsing.dart:15:50)
#12 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:27:49)
#13 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:35:48)
#14 TreeVisitor.visitElement (package:html5lib/dom_parsing.dart:44:50)
#15 _Analyzer.visitElementInfo (package:web_ui/src/analyzer.dart:175:23)
#16 _Analyzer.visitElement (package:web_ui/src/analyzer.dart:123:21)
#17 TreeVisitor.visit (package:html5lib/dom_parsing.dart:15:50)
#18 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:27:49)
#19 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:35:48)
#20 TreeVisitor.visitElement (package:html5lib/dom_parsing.dart:44:50)
#21 _Analyzer.visitElementInfo (package:web_ui/src/analyzer.dart:175:23)
#22 _Analyzer.visitElement (package:web_ui/src/analyzer.dart:123:21)
#23 TreeVisitor.visit (package:html5lib/dom_parsing.dart:15:50)
#24 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:27:49)
#25 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:35:48)
#26 TreeVisitor.visitDocument (package:html5lib/dom_parsing.dart:37:52)
#27 TreeVisitor.visit (package:html5lib/dom_parsing.dart:19:52)
#28 analyzeFile (package:web_ui/src/analyzer.dart:63:17)
#29 Compiler._analyze.<anonymous closure> (package:web_ui/src/compiler.dart:512:24)
#30 time (package:web_ui/src/utils.dart:46:24)
#31 Compiler._time (package:web_ui/src/compiler.dart:714:16)
#32 Compiler._analyze (package:web_ui/src/compiler.dart:511:14)
#33 Compiler.run.<anonymous closure> (package:web_ui/src/compiler.dart:110:15)
#34 _ThenFuture._sendValue (dart:async:397:24)
#35 _FutureImpl._setValue (dart:async:294:26)
#36 _CompleterImpl.complete (dart:async:129:21)
#37 FutureGroup.add.<anonymous closure> (package:web_ui/src/utils.dart:141:28)
#38 _ThenFuture._sendValue (dart:async:397:24)
#39 _FutureImpl._setValue (dart:async:294:26)
#40 _FutureImpl._setOrChainValue (dart:async:371:16)
#41 _ThenFuture._sendValue (dart:async:403:21)
#42 _FutureImpl._setValue (dart:async:294:26)
#43 _CatchErrorFuture._sendValue (dart:async:415:14)
#44 _FutureImpl._setValue (dart:async:294:26)
#45 _FutureImpl._setOrChainValue (dart:async:371:16)
#46 _ThenFuture._sendValue (dart:async:403:21)
#47 _FutureImpl._setValue (dart:async:294:26)
#48 _FutureImpl._setOrChainValue (dart:async:371:16)
#49 _ThenFuture._sendValue (dart:async:403:21)
#50 _FutureImpl._setValue (dart:async:294:26)
#51 _FutureListenerWrapper._sendValue (dart:async:157:21)
#52 _FutureImpl._setValue (dart:async:294:26)
#53 _FutureListenerWrapper._sendValue (dart:async:157:21)
#54 _FutureImpl._setValue (dart:async:294:26)
#55 _FutureImpl._setOrChainValue (dart:async:371:16)
#56 _ThenFuture._sendValue (dart:async:403:21)
#57 _FutureImpl._setValue (dart:async:294:26)
#58 _FutureListenerWrapper._sendValue (dart:async:157:21)
#59 _FutureImpl._setValue (dart:async:294:26)
#60 _FutureImpl._setOrChainValue (dart:async:371:16)
#61 _ThenFuture._sendValue (dart:async:403:21)
#62 _FutureImpl._setValue (dart:async:294:26)
#63 _CompleterImpl.complete (dart:async:129:21)
#64 _SendPortImpl.call.<anonymous closure> (dart:isolate-patch:106:27)
#65 _ReceivePortImpl._handleMessage (dart:isolate-patch:81:92)


Unhandled exception:
_FutureImpl._scheduleUnhandledError.<anonymous closure> (dart:async:325:9)
#1 Timer.run.<anonymous closure> (dart:async:2240:21)
#2 Timer.run.<anonymous closure> (dart:async:2248:13)
#3 Timer.Timer.<anonymous closure> (dart:async-patch:15:15)
#4 _Timer._createTimerHandler._handleTimeout (dart:io:6721:28)
#5 _Timer._createTimerHandler._handleTimeout (dart:io:6729:7)
#6 _Timer._createTimerHandler.<anonymous closure> (dart:io:6737:23)
#7 _ReceivePortImpl._handleMessage (dart:isolate-patch:81:92)

最佳答案

此错误消息是由于 web-ui 库未通过类型检查引起的。它期待一个 String 但得到一个 AttributeName从 html5lib 返回类。

查看此 issue .您是否在 html 中使用 xmlns 属性 - 也许是 svg?

您也可以在 web-ui mailing list 上发帖, 或 file a bug report .

关于html - Dart WebUI 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16080115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com