当我运行我的 Web 组件的 build.dart 时,未创建 out 文件夹并且我收到此错误:
SEVERE web/main.html: exception while reading file, original message:
AsyncError: ''package:html5lib/dom.dart': Error: line 91 pos 51: type 'LinkedHashMap' is not loaded
LinkedHashMap<dynamic, String> attributes = new LinkedHashMap();
malformed type used.'
Stack trace:
#0 Node.Node (package:html5lib/dom.dart:91:51)
#1 Document.Document (package:html5lib/dom.dart:313:16)
#2 TreeBuilder.reset (package:html5lib/src/treebuilder.dart:100:16)
#3 TreeBuilder.TreeBuilder (package:html5lib/src/treebuilder.dart:87:10)
#4 HtmlParser.HtmlParser (package:html5lib/parser.dart:148:38)
#5 parseHtml (package:web_ui/src/compiler.dart:34:16)
#6 Compiler._parseHtmlFile.<anonymous closure>.<anonymous closure> (package:web_ui/src/compiler.dart:165:28)
#7 time (package:web_ui/src/utils.dart:38:24)
#8 Compiler._time (package:web_ui/src/compiler.dart:297:16)
#9 Compiler._parseHtmlFile.<anonymous closure> (package:web_ui/src/compiler.dart:164:32)
#10 _ThenFuture._sendValue (dart:async:372:24)
有没有人有同样的问题?
更新:感谢您的回答。但是,我运行pub update
,现在如果我运行 build.dart 文件,结果是:
Uncaught Error: NoSuchMethodError : method not found: 'innerHTML'
Receiver: Instance of 'Element'
Arguments: []
Stack Trace:
#0 Object.noSuchMethod (dart:core-patch:1743:25)
#1 _ElementLoader.visitScriptElement (package:web_ui/src/analyzer.dart:879:16)
#2 _ElementLoader.visitElement (package:web_ui/src/analyzer.dart:770:40)
#3 TreeVisitor.visit (package:html5lib/dom_parsing.dart:208:50)
#4 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:220:49)
#5 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:228:48)
#6 TreeVisitor.visitElement (package:html5lib/dom_parsing.dart:237:50)
#7 _ElementLoader.visitElement (package:web_ui/src/analyzer.dart:777:34)
#8 TreeVisitor.visit (package:html5lib/dom_parsing.dart:208:50)
#9 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:220:49)
#10 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:228:48)
#11 TreeVisitor.visitElement (package:html5lib/dom_parsing.dart:237:50)
#12 _ElementLoader.visitElement (package:web_ui/src/analyzer.dart:777:34)
#13 TreeVisitor.visit (package:html5lib/dom_parsing.dart:208:50)
#14 TreeVisitor.visitChildren (package:html5lib/dom_parsing.dart:220:49)
#15 TreeVisitor.visitNodeFallback (package:html5lib/dom_parsing.dart:228:48)
#16 TreeVisitor.visitDocument (package:html5lib/dom_parsing.dart:230:52)
#17 TreeVisitor.visit (package:html5lib/dom_parsing.dart:212:52)
#18 analyzeDefinitions (package:web_ui/src/analyzer.dart:33:15)
#19 Compiler._parseAndDiscover.processHtmlFile.<anonymous closure> (package:web_ui/src/compiler.dart:123:35)
#20 time (package:web_ui/src/utils.dart:38:24)
#21 Compiler._time (package:web_ui/src/compiler.dart:291:16)
#22 Compiler._parseAndDiscover.processHtmlFile (package:web_ui/src /compiler.dart:122:27)
#23 _ThenFuture._sendValue (dart:async:372:24)