2014-07-08 55 views
0

我用DartEditor開發了一個DART /聚合物項目。由於DartEditor不支持Git,我將它移至Eclipse並安裝了Dart插件。現在突然間我發現了新的錯誤,我沒有進入Dart Editor,我不知道它們會有什麼不同。 Dart-SDK和Dartium版本完全相同。我將相應的文件夾從DartEditor複製到Eclipse文件夾中。DartEditor和Dart插件之間的區別

Eclipse插件的版本是Dart-SDK 1.6.0-dev.1.2的Dart Editor 1.6.0.dev_01_02的1.6.0.dev_01_02。

錯誤消息我得到的是:

Loading polymer transformers... 
Serving mastermind web on http://localhost:8080 
[Warning from polymer (Linter) on mastermind|web/mm-color-button.html]: 
line 2, column 1 of web/mm-color-button.html: Missing definition for <polymer-element>, please add the following HTML import at the top of this file: <link rel="import" href="packages/polymer/polymer.html">. 
[Warning from polymer (Linter) on mastermind|web/mm-game.html]: 
line 2, column 1 of web/mm-game.html: Missing definition for <polymer-element>, please add the following HTML import at the top of this file: <link rel="import" href="packages/polymer/polymer.html">. 
[Error from polymer (Linter) on mastermind|web/mm-game.html]: 
line 3, column 1 of web/mm-game.html: Polymer.dart's implementation of HTML imports are not supported within polymer element definitions, yet. Please move the import out of this <polymer-element>. 
Build error: 
Transform ImportInliner on mastermind|web/mastermind.html threw error: Could not find asset mastermind|web/mm-game.html. 

build failed with errors: {Transform polymer (Linter) on mastermind|web/mm-color-button-line.html threw error: Polymer.dart's implementation of HTML imports are not supported within polymer element definitions, yet. Please move the import out of this <polymer-element>., Transform polymer (Linter) on mastermind|web/mm-line.html threw error: Polymer.dart's implementation of HTML imports are not supported within polymer element definitions, yet. Please move the import out of this <polymer-element>., Transform polymer (Linter) on mastermind|web/mm-line.html threw error: Polymer.dart's implementation of HTML imports are not supported within polymer element definitions, yet. Please move the import out of this <polymer-element>., Transform polymer (Linter) on mastermind|web/mm-game.html threw error: Polymer.dart's implementation of HTML imports are not supported within polymer element definitions, yet. Please move the import out of this <polymer-element>.} 

也許這是因爲不同的聚合物的版本。在DartEditor中,我有0.9.5 + 2和Eclipse 0.11.0 + 5。我認爲pub發佈會自動更新包到最新版本,如果依賴關係是任何。

聚合物發生了什麼變化?爲什麼現在這個錯誤?

+0

錯誤消息看起來不完整。你可以再次檢查它們並將它們格式化爲代碼(選擇文本並用大括號[{}]')按下工具欄按鈕)。對我來說,你似乎有不同版本的聚合物包裝。請檢查這一點。 –

+0

我用完整的錯誤文本和聚合物版本更新了我的問題。 – Gregor

回答

2

這些都是正常的消息,我不認爲它們是由Eclipse插件引起的。

能否請你檢查,你有polymer.html進口在各聚合物元素定義文件

<link rel="import" href="packages/polymer/polymer.html"> 

<!-- other element imports --> 

<polymer-element name='some-name> 
    <!-- no elements imports in here or below --> 
    <template> 
    <!-- style imports are allowed here --> 
    </template> 
    <script ...> 
</polymer-element> 
+0

不,我不知道。這以前不需要。我應該怎樣處理元素之間的聯繫? – Gregor

+0

自從最近一次Polymer更新以來,這是一項要求。如果您在''標籤內部輸入了元素,請將它們移動到標籤之上,但低於'polymer.html'輸入。 –

+1

好的,添加聚合物元素導入並移動外部元素導入可以清除這些錯誤。但是我沒有得到別人。我的聚合物元素沒有陰影根,所以看起來:NoSuchMethodError:找不到方法:'querySelector'。我將爲此打開另一個問題。 – Gregor

0

這不是Eclipse插件,飛鏢編輯器之間的差異的頂部,但之間不同版本的聚合物包裝。兩個版本之間有很多變化,我必須相應地調整代碼。