2015-04-16 54 views
0

我剛剛更新了我的聚合物項目(涼亭更新)以切換到新的webcomponents.js庫。 但是我得到一個: 「遺漏的類型錯誤:未定義是不是一個函數」 上polymer.js:12從platform.js升級到webcomponents.js問題

這是我的index.html頁面:

<!doctype html> 
<html class="no-js"> 
<head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <title>Nautes Dashboard</title> 
    <meta name="description" content=""> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> 

    <!-- build:css styles/main.css --> 
    <link rel="stylesheet" href="styles/main.css"> 
    <!-- endbuild--> 

    <!-- Place your HTML imports here --> 
    <script src="bower_components/webcomponentsjs/webcomponents.js"></script> 
    <link rel="import" href="elements/elements.html"> 

</head> 
<body> 

    <nautes-pass-dashboard> 
    </nautes-pass-dashboard> 

    <script> 
    document.addEventListener('polymer-ready', function() { 
     // Perform some behaviour 
    }); 
    </script> 
</body> 

我要切換回到舊的進口,使所有的工作再次:

<script src="bower_components/platform/platform.js"></script> 

我做錯了什麼更新我的項目?

+0

您是否嘗試將聚合物更新爲0.5 – Adi

回答

1

如果您仍然使用platform.js我猜你使用的是舊版本的聚合物。 我的猜測是,當您更新到webcomponents.js時,您保留了聚合物的舊版本,即與webcomponents.js不兼容。

如果我的猜測是正確的,你需要更新你所有的聚合物設置,不僅改變platform.jswebcomponents.js。採用聚合物0.5.5版本,它應該更好地工作。

+0

非常感謝您的確是我的項目中聚合物版本的問題。做涼亭更新沒有升級安裝的聚合物版本。現在它全部正常工作! :) –