Dart混乱TYPE错误 [英] Dart confusing TYPE error
问题描述
我正在使用dart和web_ui构建web应用程序。
一切正常,直到我添加了web_ui pub,现在,当我试图运行build.dart文件我得到一个错误:
未捕获错误:type'AttributeName'不是'String'类型的子类型'名称'。
这是什么意思?
从我的理解,这意味着有一个名为'name'的类'AttributeName'的实例是扩展'String'类。
我搜索了整个项目,没有一个名为AttributeName的类,没有name的实例。
最新的Dart编辑器和SDK:
Dart编辑器版本0.4.7_r21658
Dart SDK版本0.4.7.5_r21658
编辑:
这是我的build.dart文件:
import'package:web_ui / component_build.dart';
import'dart:io';
void main(){
build(new Options()。arguments,['web / menyplattan.html']);
}
此外,我更新了所有的pub
类似的 SO问题 MarioP链接有一个stacktrace显示这个消息来自web ui库本身。
你的html中有一个xmlns属性吗?
请查看此网络用户问题。 / p>
AttributeName 在html5lib库中定义。也许web-ui期待这个库的较新版本,但得到一个较旧的。确保您已完成发布栏安装。您也可以尝试删除您的软件包文件夹,并执行一个新的pub安装。
这可能是由过时的软件包,但也可能是一个错误web-ui。查看您是否可以获取stacktrace并提交错误报告,或者发布网络ui邮寄名单。 p>
I am building a web application using dart with web_ui.
Everything was working fine until i added the web_ui pub, and now, when I am trying to run a build.dart file I get an error:
Uncaught Error: type 'AttributeName' is not a subtype of type 'String' of 'name'.
What does this mean?
From what I understand, this means there is somewhere an instance named 'name' of class 'AttributeName' that is extending 'String' class.
I searched my entire project and there is nowhere a class named 'AttributeName', nowhere an instance of 'name'.
I have the latest Dart editor and SDK:
Dart Editor version 0.4.7_r21658
Dart SDK version 0.4.7.5_r21658
EDIT: this is my build.dart file:
import 'package:web_ui/component_build.dart';
import 'dart:io';
void main() {
build(new Options().arguments, ['web/menyplattan.html']);
}
Also, i updated all the pubs
This message looks like web_ui is failing a type check.
The similar SO question MarioP links to has a stacktrace showing this message coming from within the web ui library itself.
Do you have an xmlns attribute in your html? Have a look at this web-ui issue.
AttributeName is defined within the html5lib library. Perhaps web-ui is expecting a newer version of this library but getting an older one. Make sure you've done a pub install. You can also try deleting your packages folder and doing a fresh pub install.
This could be caused by out-of-date packages, but it could also be a bug in web-ui. See if you can get a stacktrace and file a bug report, or post it on the web-ui mailing list.
这篇关于Dart混乱TYPE错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!