Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web 聚合物飞镖0.10.0:“;解释为脚本但使用MIME类型应用程序/dart传输的资源;而试图以Javascript的形式运行_Web_Dart_Polymer_Dart2js - Fatal编程技术网

Web 聚合物飞镖0.10.0:“;解释为脚本但使用MIME类型应用程序/dart传输的资源;而试图以Javascript的形式运行

Web 聚合物飞镖0.10.0:“;解释为脚本但使用MIME类型应用程序/dart传输的资源;而试图以Javascript的形式运行,web,dart,polymer,dart2js,Web,Dart,Polymer,Dart2js,我有一个polymer 0.10+网络应用程序,在Dartium(Dart VM)中运行,一直运行到polymer 0.10.0-12之前 当我将其编译为JS(Pub Build)并在Google Chrome下以JS的形式运行时,我的polymer(大)组件不会出现,控制台中有这样一条消息: “资源被解释为脚本,但使用MIME类型的应用程序/dart传输:”127.0.0.1:8080/cvwebkit.html_bootstrap.dart“。cvwebkit.html:295” 第295行

我有一个polymer 0.10+网络应用程序,在Dartium(Dart VM)中运行,一直运行到polymer 0.10.0-12之前

当我将其编译为JS(Pub Build)并在Google Chrome下以JS的形式运行时,我的polymer(大)组件不会出现,控制台中有这样一条消息:

“资源被解释为脚本,但使用MIME类型的应用程序/dart传输:”127.0.0.1:8080/cvwebkit.html_bootstrap.dart“。cvwebkit.html:295”

第295行:

当我在build目录中的cvwebkit.html中将这一行更改为
时,它就可以工作了

当我直接启动修改后的文件时,我有这个url,它可以(至少部分)工作127.0.0.1:3030/CVWebkit/WebApp/build/web/CVWebkit.html

当我以JS的形式正常启动“dev”文件时,我遇到了上述url问题:127.0.0.1:8080/cvwebkit.html

我的“头”:


CVWebKit
出口“包装:聚合物/初始省道”;

有什么想法吗?

试着把你的类型改成这个。type=“application/dart;component=1”在所有聚合物元件中。在索引/main中,添加以下内容。然后构建并编译该消息可以忽略。但戴夫是对的;component=1是必需的,并且在标题部分导入polymer/polymer.html。感谢您的回复。但你不能再这样做了,因为聚合物0.10-1.13。最新版本目前为Polymer 0.10.1“最终版”。我的应用程序使用聚合物0.10-12之前。我尝试了你的建议,但没有成功(只有警告)。我在第一篇文章的末尾加上我的“头”;组件=1已从0.10.0过期
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CVWebKit</title>
<link rel="stylesheet" href="cvwebkit.css">
<link rel="import" href="packages/polymer/polymer.html">
<link rel="import" href="imgdyn.html"> <!--to ensure dynamic assets are created by polymer, so that there is no attempt first by the browser-->
<link rel="import" href="cvwebkitscript.html"> <!--needed to include the link to the dart script as we can't use both "src" and "export" in the script line-->
<link rel="import" href="zone-ruban.html">
<script type="application/dart">export 'package:polymer/init.dart';</script>
</head>